Example #1
0
    void Start()
    {
        mapPositionScript    = gameObject.GetComponent <MapPosition>();
        randomPositionScript = gameObject.GetComponent <RandomPosition>();
        mapArea = mapPositionScript.GetMapPosition();

        StartCoroutine(startHurricane());
    }
Example #2
0
    void Awake()
    {
        randomPositionScript = gameObject.GetComponent <RandomPosition>();
        mapPositionScript    = gameObject.GetComponent <MapPosition>();

        float[,] mapArea = mapPositionScript.GetMapPosition();
        healthSliders    = (Slider[])FindObjectsOfType(typeof(Slider));
        CreatePlayers(mapArea);
    }
Example #3
0
    void Start()
    {
        mapPositionScript    = gameObject.GetComponent <MapPosition>();
        randomPositionScript = gameObject.GetComponent <RandomPosition>();

        mapArea = mapPositionScript.GetMapPosition();

        TileBreak.OnBreak += listenOnTileBreak;

        StartCoroutine(StartHail());
    }
Example #4
0
    void Start()
    {
        mapPositionScript    = gameObject.GetComponent <MapPosition>();
        randomPositionScript = gameObject.GetComponent <RandomPosition>();

        mapArea = mapPositionScript.GetMapPosition();

        InitFoodSpawn();

        TileBreak.OnBreak += listenOnTileBreak;
        Food.OnRemove     += listenOnFoodDestroy;
    }
Example #5
0
    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;
        }
    }
Example #6
0
 void listenOnTileBreak(TileBreak tileBreak)
 {
     mapArea = mapPositionScript.GetMapPosition();
 }