// Start is called before the first frame update
    void Start()
    {
        if (!inventory)
        {
            inventory = GetComponent <Inventory>();
        }

        if (getLeftOne)
        {
            evCheck = FindClosetElevationCheck.GetTheLeftOne();
        }
        else
        {
            evCheck = FindClosetElevationCheck.GetTheRighttOne();
        }

        Blockbuilder[] bbs = FindObjectsOfType <Blockbuilder>();

        foreach (Blockbuilder bs in bbs)
        {
            if (GetComponent <Transform>().localPosition.x < 0 && bs.transform.position.x < 0)
            {
                blockbuilder = bs;
            }

            if (GetComponent <Transform>().localPosition.x > 0 && bs.transform.position.x > 0)
            {
                blockbuilder = bs;
            }
        }

        timeLeftToNextGen = timeBetweenGenerations;
    }
Esempio n. 2
0
    private void Start()
    {
        if (leftElevation)
        {
            elevationCheck = FindClosetElevationCheck.GetTheLeftOne();
        }
        else
        {
            elevationCheck = FindClosetElevationCheck.GetTheRighttOne();
        }

        img       = GetComponent <Image>();
        img.color = color;
    }