Esempio n. 1
0
    void OnEnable()
    {
        currResourceStored = 0;
        currRock = null;
        currRockWorldPos = new Vector3();

        myTransform = transform;

        build_handler = GetComponent<Building_Handler>();

        _state = State.SEARCHING;
    }
Esempio n. 2
0
    void OnEnable()
    {
        currResourceStored = 0;

        myTransform = transform;

        build_handler = GetComponent<Building_Handler>();

        _state = State.SEARCHING;
    }
    void Start()
    {
        build_handler = GetComponentInParent<Building_Handler>();

        stats.Init();

        // Initialize Gun stats, starting ammo
        //gunStats.Init();

        // Set initial reload Count Down to starting reload time
        reloadCountDown = gunStats.currReloadTime;

        // Also set the initial ammo
        ammoCount = gunStats.currAmmo;

        // Set the count down to Shoot to this Tower's fire rate
        shootCountDown = stats.curRateOfAttk;

        resourceGrid = ResourceGrid.Grid;

        objPool = ObjectPool.instance;

        // Get our Sprite Renderer from Parent ( this is how the prefab is set-up )
        if (GetComponentInParent<SpriteRenderer>() != null)
        {

            sr = GetComponentInParent<SpriteRenderer>();

            // Get the Line Renderer Component from Child object sightStart
            lineR = sightStart.GetComponent<LineRenderer>();
            lineR.sortingLayerName = sr.sortingLayerName;
            lineR.sortingOrder = sr.sortingOrder;

        }
    }