// 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;
    }
Beispiel #2
0
 private void Start()
 {
     cannonObj = this.gameObject;
     animator  = GetComponent <Animator>();
     cannon    = cannonObj.GetComponent <Cannon>();
     StartCoroutine(MinHjärnaDog());
     elevationCheck = FindClosetElevationCheck.GetClosets(gameObject);
 }
Beispiel #3
0
    void Start()
    {
        ElevationCheck elevationCheck    = FindClosetElevationCheck.GetClosets(gameObject);
        float          heightPercentense = elevationCheck.groundlevel + restictValue;
        var            pos = transform.position;

        pos.y = heightPercentense + 0.5f;

        transform.position = pos;
    }
Beispiel #4
0
    private void Start()
    {
        if (leftElevation)
        {
            elevationCheck = FindClosetElevationCheck.GetTheLeftOne();
        }
        else
        {
            elevationCheck = FindClosetElevationCheck.GetTheRighttOne();
        }

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