Example #1
0
        public Task Initialize(PlayerConfig config, bool isView)
        {
            if (Physics == null)
            {
                Physics = GetComponent <CharacterPhysics>();
            }

            Movers = new CharacterMover[] {
                new HitstunMovement(),
                new RespawnMovement(),
                new LedgeMovement(),
                new AerialMovement(),
                new GroundMovement(),
            };

            foreach (var mover in Movers)
            {
                mover.Character = this;
            }

            return(Task.CompletedTask);
        }
 /// <summary>
 /// Awake is called when the script instance is being loaded.
 /// </summary>
 void Awake()
 {
     Physics  = GetComponentInChildren <CharacterPhysics>();
     Movement = GetComponentInChildren <CharacterMovement>();
     Shield   = GetComponentInChildren <CharacterShield>();
 }