protected virtual void PassWeaponHotkey(int index)
 {
     if (!ControlledPawn)
     {
         return;
     }
     ControlledPawn.PassWeaponHotkey(index);
 }
    protected virtual void PassInventory(bool value)
    {
        if (!ControlledPawn)
        {
            return;
        }

        ControlledPawn.PassRadialMenu(value);
    }
    protected virtual void PassCrouchInput(bool value)
    {
        if (!ControlledPawn)
        {
            return;
        }

        ControlledPawn.PassCrouchInput(value);
    }
    protected virtual void PassScrollInput(float value)
    {
        if (!ControlledPawn)
        {
            return;
        }

        ControlledPawn.PassScrollInput(value);
    }
    protected virtual void PassSecondaryActionInput(float value)
    {
        if (!ControlledPawn)
        {
            return;
        }

        ControlledPawn.PassSecondaryActionInput(value);
    }
    protected virtual void PassLookInput(Vector2 value)
    {
        if (!ControlledPawn)
        {
            return;
        }

        ControlledPawn.PassLookInput(value);
    }
    protected virtual void OnLoseControl()
    {
        if (!_controlledPawn)
        {
            return;
        }

        ControlledPawn.OnStopControlled(this);
        ControlledPawn.PassLockScreen(false);
    }
 protected virtual void PassStart(bool value)
 {
     //Might not connect to pawn, not sure.
     //Will need to display on the camera of this pawn though, so maybe.
     if (value)
     {
         //Debug.Log(name + " START");
         ControlledPawn.PassLockScreen(!ControlledPawn.MyLookScript.lockState);
     }
 }
Пример #9
0
    // Update is called once per frame
    void Update()
    {
        if (null == ControlledPawn)
        {
            return;
        }


        if (Input.GetKey(KeyCode.LeftArrow))
        {
            ControlledPawn.Walk(-INPUT_MOVE_SPEED);
        }
        if (Input.GetKey(KeyCode.RightArrow))
        {
            ControlledPawn.Walk(INPUT_MOVE_SPEED);
        }
        if (Input.GetKey(KeyCode.DownArrow))
        {
            ControlledPawn.Crouch();
        }
        if (Input.GetKey(KeyCode.UpArrow))
        {
            ControlledPawn.Skill(Pawn.eSkillFlag.JUMP);
        }
        if (Input.GetKey(KeyCode.Space))
        {
            ControlledPawn.Skill(Pawn.eSkillFlag.ATTACK);
        }
        if (Input.GetKey(KeyCode.Z))
        {
            ControlledPawn.Skill(Pawn.eSkillFlag.SKILL_Z);
        }
        if (Input.GetKey(KeyCode.X))
        {
            ControlledPawn.Skill(Pawn.eSkillFlag.SKILL_X);
        }
        if (Input.GetKey(KeyCode.C))
        {
            ControlledPawn.Skill(Pawn.eSkillFlag.SKILL_C);
        }
        if (Input.GetKey(KeyCode.V))
        {
            ControlledPawn.Skill(Pawn.eSkillFlag.SKILL_V);
        }
    }
Пример #10
0
    //Tell this player controller to 'control' a specific pawn
    //This is like saying "Player 1, start controlling the ghost pawn"
    /* Contributors: Scott Kauker */
    public void Possess(Pawn p)
    {
        //If they were already controlling something, unpossess it
        if (ControlledPawn != null)
        {
            ControlledPawn.SetController(null);
            ControlledPawn = null;
        }

        //If the given input pawn is already possessed, unpossess that one too
        if (p != null && p.Controller != null)
        {
            p.Controller.Possess(null);
        }

        //Now actually possess the new pawn
        ControlledPawn = p;
        if (ControlledPawn != null)
        {
            ControlledPawn.SetController(this);
        }
    }