Example #1
0
    //initialization
    private void Start()
    {
        GameEvents.current.onTowerSelected   += OnTowerSelected;
        GameEvents.current.onTowerUnselected += OnTowerUnselected;

        buttons    = this.gameObject.GetComponentsInChildren <Button>();
        rect       = this.gameObject.GetComponent <RectTransform>();
        moveUiComp = this.gameObject.GetComponent <MoveUIComponent>();
        this.gameObject.SetActive(false);
    }
    // initialization
    private void Start()
    {
        GameEvents.current.onTowerOrTrapBuild += cancel;

        buttons    = this.gameObject.GetComponentsInChildren <Button>();
        rect       = this.gameObject.GetComponent <RectTransform>();
        moveUiComp = this.gameObject.GetComponent <MoveUIComponent>();
        kotoTower  = GameObject.FindGameObjectWithTag("Koto Tower").GetComponent <ClickOnKotoTower>();
        generator  = GameObject.FindGameObjectWithTag("Generator").GetComponent <ClickOnGenerator>();

        this.gameObject.SetActive(false);
    }
Example #3
0
    // initialization
    private void Start()
    {
        GameEvents.current.onTruckDestroyedEnter += OnTruckDestroyed;
        GameEvents.current.onTruckAnswerEnter    += OnTruckAnswer;
        GameEvents.current.onTruckSentEnter      += OnTruckSent;

        truckMove    = false;
        buttons      = this.gameObject.GetComponentsInChildren <Button>(true);
        rect         = this.gameObject.GetComponent <RectTransform>();
        rectHeight   = rect.rect.height;
        currentValue = rectHeight + 10;
        moveUiComp   = this.gameObject.GetComponent <MoveUIComponent>();
    }