Activate() public method

public Activate ( ) : void
return void
Esempio n. 1
0
    public void Push()
    {
        if (this.GetComponent <Animation> ())
        {
            this.GetComponent <Animation>().Play();
        }

        if (platform)
        {
            platform.Activate();
        }
    }
Esempio n. 2
0
 public void CheckButton()
 {
     if (Utility.Vector3Round(m_board.PlayerNode.Coordinates) == transform.position || m_board.Enemies.Exists(e => e.GetNode().Coordinates == transform.position))
     {
         StartCoroutine(BlinkHalo());
         if (targetPlatform != null)
         {
             targetPlatform.Activate();
         }
         if (targetBlock != null)
         {
             targetBlock.Activate();
         }
     }
 }
Esempio n. 3
0
    public IEnumerator HighlightNewPlatform()
    {
        _waitingForAction = true;


        Vector3 lastPos = Vector3.zero;
        Vector3 lastDir = Vector3.zero;

        while (BuildingMenuActive)
        {
            while (_waitingForAction)
            {
                if (lastPos != _playerRefs.CurrentPlatform.transform.localPosition || lastDir != _playerRefs.LookDirection)
                {
                    _highlightedPlatform?.Deactivate();
                    _highlightedPlatform = _gridManager.GetPlatformForHighlight(_playerRefs.CurrentPlatform.transform.localPosition, _playerRefs.LookDirection, _currentBuildingOp);
                    _highlightedPlatform.Highlight(_currentBuildingOp);

                    if (!_highlightedPlatform.Activated)
                    {
                        _canBuild = true;
                    }
                    else
                    {
                        _canBuild = false;
                    }
                }

                lastPos = _playerRefs.CurrentPlatform.transform.localPosition;
                lastDir = _playerRefs.LookDirection;
                //Debug.Log("WaitBegin " + Time.time);
                yield return(_waiter);
                //Debug.Log("WaitEnd " + Time.time);
            }

            if (_buildAction)
            {
                _highlightedPlatform?.Activate();

                if (_currentBuildingOp == 0)
                {
                    _resourceMan.DecrementResource(_platformData.Platform1_Cost);
                }
                else
                {
                    _resourceMan.DecrementResource(_platformData.Platform2_Cost);
                }

                //Wait a frame for Wall Deactivation
                for (int i = 0; i < 3; i++)
                {
                    yield return(null);
                }

                _waitingForAction = true;
                //_navSurface.BuildNavMesh();
                _navSurface.UpdateNavMesh(_navSurface.navMeshData);

                BUILDING_IN_PROGESS = false;
                RessourceCheck();
            }

            _highlightedPlatform = null;

            yield return(null);
        }
    }