Пример #1
0
 public void Start()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Пример #2
0
    public void UnSubscribeDirectionEventHandlers()
    {
        ds = DirectionSelector.instance;

        ds.UpButton.onClick.RemoveAllListeners();
        ds.DownButton.onClick.RemoveAllListeners();
        ds.LeftButton.onClick.RemoveAllListeners();
        ds.RightButton.onClick.RemoveAllListeners();
        ds.UpLeftButton.onClick.RemoveAllListeners();
        ds.UpRightButton.onClick.RemoveAllListeners();
        ds.DownLeftButton.onClick.RemoveAllListeners();
        ds.DownRightButton.onClick.RemoveAllListeners();
    }
Пример #3
0
    public void SubscribeDirectionEventHandlers()
    {
        ds = DirectionSelector.instance;

        ds.UpButton.onClick.AddListener(delegate { ChooseDirection(MovementDirection.UP); });
        ds.DownButton.onClick.AddListener(delegate { ChooseDirection(MovementDirection.DOWN); });
        ds.LeftButton.onClick.AddListener(delegate { ChooseDirection(MovementDirection.LEFT); });
        ds.RightButton.onClick.AddListener(delegate { ChooseDirection(MovementDirection.RIGHT); });
        ds.UpLeftButton.onClick.AddListener(delegate { ChooseDirection(MovementDirection.UPLEFT); });
        ds.UpRightButton.onClick.AddListener(delegate { ChooseDirection(MovementDirection.UPRIGHT); });
        ds.DownLeftButton.onClick.AddListener(delegate { ChooseDirection(MovementDirection.DOWNLEFT); });
        ds.DownRightButton.onClick.AddListener(delegate { ChooseDirection(MovementDirection.DOWNRIGHT); });
    }
Пример #4
0
    public Player Init(Vector2 startingPosition, int index)
    {
        Debug.Log("Player.Init");

        _startingPosition = startingPosition;
        Index             = index;
        GameObject positionSelectorObject = GameObject.Find("P" + Index + "PositionSelector");

        PositionSelector = positionSelectorObject.GetComponent <PositionSelector>();
        DirectionLabel   = GameObject.Find("P" + Index + "DirectionLabel");
        GameObject directionSelectorObject = GameObject.Find("P" + Index + "DirectionSelector");

        DirectionSelector = directionSelectorObject.GetComponent <DirectionSelector>();
        GameObject distanceSelectorObject = GameObject.Find("P" + Index + "DistanceSelector");

        DistanceSelector = distanceSelectorObject.GetComponent <DistanceSelector>();
        return(this);
    }
Пример #5
0
 public SelectWaitDirectionState(Actor currActor)
 {
     this.currActor = currActor;
     newDirection   = currActor.actorData.directionFacing;
     directionArrow = Globals.GetBoardManager().ui.dirSelector;
 }