void Start() { Trees = (TreesManager)GameObject.FindObjectOfType(typeof(TreesManager)); if (dayNight == null) { dayNight = (DayNightCycle)GameObject.FindObjectOfType(typeof(DayNightCycle)); } }
private void getRemovedIndex(string indexremoved) { if (Trees == null) Trees = (TreesManager)GameObject.FindObjectOfType (typeof(TreesManager)); if (Trees == null) return; Trees.UpdateRemovedTrees (indexremoved); }
private IEnumerator Die() { for (int i = 0; i < _countResources; i++) { PoolManager.GetObject(_resource.name, transform.position, _resource.transform.rotation); } _animator.SetTrigger("Death"); yield return(new WaitForSeconds(_animator.GetCurrentAnimatorStateInfo(0).length)); TreesManager.SetTreeDisabled(gameObject); }
public void UpdateRemovedTrees() { if (Trees == null) Trees = (TreesManager)GameObject.FindObjectOfType (typeof(TreesManager)); if (Trees == null) return; if (Network.isServer && networkViewer) { networkViewer.RPC ("getRemovedIndex", RPCMode.Others, Trees.GetRemovedTrees ()); } }
/// <summary> /// Awake is called when the script instance is being loaded. /// </summary> void Awake() { if (instance == null) { instance = this; } if (instance != this) { Destroy(gameObject); } GenerateTrees(); }
public void OpenMenu() { _player.SavePlayer(); TreesManager.SaveTrees(); SceneManager.LoadScene(0); }
private void sendRemovedTreeIndex(int index) { if (Trees == null) Trees = (TreesManager)GameObject.FindObjectOfType (typeof(TreesManager)); if (Trees == null) return; Trees.RemoveATrees (index); }
private void resetAllTrees() { if (Trees == null) Trees = (TreesManager)GameObject.FindObjectOfType (typeof(TreesManager)); if (Trees == null) return; Trees.ResetTrees (); }
void Start() { networkViewer = this.GetComponent<NetworkView> (); Trees = (TreesManager)GameObject.FindObjectOfType (typeof(TreesManager)); }