Пример #1
0
    void Start()
    {
        cc = GetComponent <SharedCharacterController>();
        sr = GetComponent <SpriteRenderer>();

        hitbox.OnTrigger += HandleCollision;
    }
    private void StartForcedMovement(bool isStartingLastWord)
    {
        for (int playerNum = 0; playerNum < players.Length; ++playerNum)
        {
            int playerNumCopy = playerNum;
            ForceMoveTransitionInfo transitionInfo = new ForceMoveTransitionInfo
            {
                onCompleteMove   = (ForceMoveTransitionInfo.AllInPositionAction onAllInPosition) => OnCompleteMove(playerNumCopy, isStartingLastWord, onAllInPosition),
                isLastWordCaster = isStartingLastWord && playerNum == lastWordPlayerNumber,
                moveTime         = lastWordMoveTime,
            };

            SharedCharacterController cc = players[playerNum].GetComponent <SharedCharacterController>();
            if (isStartingLastWord)
            {
                transitionInfo.moveDestination = lastWordPositions[playerNum].position;
            }
            else if (cc.HasCircle())
            {
                transitionInfo.moveDestination = cc.GetCirclePosition();
            }
            else
            {
                transitionInfo.moveDestination = spawnPoints[playerNum].position;
            }

            switch (CharacterSelection.Instance.GetPlayerCharacterType(playerNum))
            {
            case CharacterType.SELENE:
                Selene selene = players[playerNum].GetComponent <Selene>();
                selene.ChangeStateSoft <SeleneForceMoveState>(transitionInfo);
                break;

            case CharacterType.RHEA:
                Rhea rhea = players[playerNum].GetComponent <Rhea>();
                rhea.ChangeStateSoft <RheaForceMoveState>(transitionInfo);
                break;
            }
        }
    }
 // Start is called before the first frame update
 void Start()
 {
     charTar    = GetComponent <CharacterTargeting>();
     bulletList = new List <IMutatable>();
     charCon    = GetComponent <SharedCharacterController>();
 }
Пример #4
0
 // Start is called before the first frame update
 void Start()
 {
     charTar = GetComponent <CharacterTargeting>();
     charCon = GetComponent <SharedCharacterController>();
 }