Esempio n. 1
0
        void Start()
        {
            actorPhysics = GetComponent <ActorPhysics2D>();

            if (actorController == null)
            {             // no controller eh?
                actorController = GetComponent <IActorController>();
            }

            actorController.OnActorControl(this);
            actorController.enabled = true;
        }
Esempio n. 2
0
        public void Depossess()
        {
            inputVector     = Vector2.zero;
            actorController = storedController;
            if (actorController == null)
            {            // no controller eh?
                actorController = GetComponent <IActorController>();
                actorController.OnActorControl(this);
            }

            actorController.enabled = true;
        }
Esempio n. 3
0
        public bool Possess(IActorController icontroller)
        {
            if (actorController is PlayerActorController)
            {
                return(false);
            }

            if (actorController != null)
            {             // this is probably the player possessing; store this controller for later
                storedController         = actorController;
                storedController.enabled = false;
            }

            actorController = icontroller;
            actorController.OnActorControl(this);
            return(true);
        }
Esempio n. 4
0
 public void SetActorController(IActorController icontroller)
 {
     actorController = icontroller;
     actorController.OnActorControl(this);
 }