Exemple #1
0
        public KinematicCharacterMotor SpawnMotor(KinematicCharacterMotor motorPrefab, Vector3 position, Quaternion rotation, Transform parent = null)
        {
            var motor = Instantiate(motorPrefab, position, rotation, parent);

            CharacterMotors.Add(motor);
            return(motor);
        }
Exemple #2
0
 public void UnRegisterMotor(KinematicCharacterMotor motor)
 {
     if (!CharacterMotors.Contains(motor))
     {
         return;
     }
     CharacterMotors.Remove(motor);
     OnMotorUnRegistered?.Invoke(motor);
 }
Exemple #3
0
 public void RegisterMotor(KinematicCharacterMotor motor)
 {
     if (CharacterMotors.Contains(motor))
     {
         return;
     }
     CharacterMotors.Add(motor);
     OnMotorRegistered?.Invoke(motor);
 }