浏览代码

Hide Key when the chest opens

/AdsTesting
Arturo Nereu 4 年前
当前提交
14ce9f6c
共有 4 个文件被更改,包括 29 次插入8 次删除
  1. 10
      Assets/Prefabs/Chest.prefab
  2. 16
      Assets/Scripts/Gameplay/Chest.cs
  3. 7
      Assets/Scripts/PlayerConfigurator.cs
  4. 4
      UserSettings/EditorUserSettings.asset

10
Assets/Prefabs/Chest.prefab


m_Name:
m_EditorClassIdentifier:
m_ParticleSystem: {fileID: 5116346864126037614}
m_ParticlePlayDelayTime: 0.55
m_ParticlePlayDelayTime: 0.65
m_Key: {fileID: 1303052936717085872}
m_KeyDestroyDelayTime: 1.15
--- !u!1001 &5116346864751513382
PrefabInstance:
m_ObjectHideFlags: 0

objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 36ebe18f236e1de46bc8992b07028de4, type: 3}
--- !u!1 &1303052936717085872 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 7024289968253537756, guid: 36ebe18f236e1de46bc8992b07028de4,
type: 3}
m_PrefabInstance: {fileID: 8317608924234293612}
m_PrefabAsset: {fileID: 0}
--- !u!4 &1828055803584411146 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 7651785289792739174, guid: 36ebe18f236e1de46bc8992b07028de4,

16
Assets/Scripts/Gameplay/Chest.cs


using System;
using System.Collections;
using UnityEngine;

[SerializeField]
private float m_ParticlePlayDelayTime = 0.75f;
[SerializeField]
private GameObject m_Key;
[SerializeField]
private float m_KeyDestroyDelayTime = 0.75f;
// Start is called before the first frame update
void Start()
{

m_Animator.SetTrigger("Open");
StartCoroutine(PlayParticles());
StartCoroutine(DestroyKey());
}
private IEnumerator DestroyKey()
{
yield return new WaitForSeconds(m_KeyDestroyDelayTime);
m_Key.SetActive(false);
}
private IEnumerator PlayParticles()

7
Assets/Scripts/PlayerConfigurator.cs


m_HatLoadingHandle.Completed += OnHatInstantiated;
}
private void OnDisable()
{
m_HatLoadingHandle.Completed -= OnHatInstantiated;
}
private void OnHatInstantiated(AsyncOperationHandle obj)
{
// We can check for the status of the InstantiationAsync operation: Failed, Succeeded or None

}
m_HatLoadingHandle.Completed -= OnHatInstantiated;
}
}

4
UserSettings/EditorUserSettings.asset


value: 22424703114646680e0b0227036c731f171311242b1b2535232c5326ece92021
flags: 0
RecentlyUsedScenePath-4:
value: 22424703114646680e0b0227036c7315001214157c7868252320092a
value: 22424703114646680e0b0227036c6c0419051d6439262f2434
value: 22424703114646680e0b0227036c6c0419051d6439262f2434
value: 22424703114646680e0b0227036c7315001214157c7868252320092a
flags: 0
vcSharedLogLevel:
value: 0d5e400f0650

正在加载...
取消
保存