void Start() { mapPositionScript = gameObject.GetComponent <MapPosition>(); randomPositionScript = gameObject.GetComponent <RandomPosition>(); mapArea = mapPositionScript.GetMapPosition(); StartCoroutine(startHurricane()); }
void Awake() { randomPositionScript = gameObject.GetComponent <RandomPosition>(); mapPositionScript = gameObject.GetComponent <MapPosition>(); float[,] mapArea = mapPositionScript.GetMapPosition(); healthSliders = (Slider[])FindObjectsOfType(typeof(Slider)); CreatePlayers(mapArea); }
void Start() { mapPositionScript = gameObject.GetComponent <MapPosition>(); randomPositionScript = gameObject.GetComponent <RandomPosition>(); mapArea = mapPositionScript.GetMapPosition(); TileBreak.OnBreak += listenOnTileBreak; StartCoroutine(StartHail()); }
void Start() { mapPositionScript = gameObject.GetComponent <MapPosition>(); randomPositionScript = gameObject.GetComponent <RandomPosition>(); mapArea = mapPositionScript.GetMapPosition(); InitFoodSpawn(); TileBreak.OnBreak += listenOnTileBreak; Food.OnRemove += listenOnFoodDestroy; }
IEnumerator TemporarilyDisablePlatform(BoxCollider[] meshColliders) { float respawnIn = respawnTimeRandom ? Random.Range(respawnTime - respawnTimeDeviation, respawnTime + respawnTimeDeviation) : respawnTime; yield return(new WaitForSeconds(respawnIn)); gameObject.GetComponent <MeshRenderer>().enabled = true; float [,] mapDimension = mapPosition.GetMapPosition(); Vector3 position = randomPosition.GetRandomPosition( mapDimension[0, 0], mapDimension[0, 1], mapDimension[1, 0], mapDimension[1, 1], mapDimension[2, 0], mapDimension[2, 1] ); gameObject.transform.position = position; foreach (BoxCollider meshCollider in meshColliders) { meshCollider.enabled = true; } }
void listenOnTileBreak(TileBreak tileBreak) { mapArea = mapPositionScript.GetMapPosition(); }