Exemplo n.º 1
0
 private void CommandManager__controlledPressurePlateChanged(NPCPressurePlate obj)
 {
     if (obj)
     {
         _navMeshAgent.destination = obj.transform.position;
     }
 }
Exemplo n.º 2
0
    public void CompleteProgress(NPCCommandable commandable)
    {
        if (commandable is NPCCommand && NpcControlled != (NPCCommand)commandable)
        {
            if (NpcControlled)
            {
                NpcControlled.UnCommand();
            }

            NpcControlled = (NPCCommand)commandable;
            _controlledNpcChanged?.Invoke(NpcControlled);
            NpcControlled.Command();
        }

        if (commandable is NPCPressurePlate && NpcControlled != (NPCPressurePlate)commandable)
        {
            if (PressurePlateController)
            {
                PressurePlateController.UnCommand();
            }

            PressurePlateController = (NPCPressurePlate)commandable;
            _controlledPressurePlateChanged?.Invoke(PressurePlateController);
            PressurePlateController.Command();
        }
    }