Example #1
0
 public State_Grounded(Controller_Player controller, StateMachine stateMachine, Rigidbody rb, Camera cam)
     : base(controller, stateMachine)
 {
     this.controller   = controller;
     this.stateMachine = stateMachine;
     this.rb           = rb;
     this.cam          = cam;
 }
Example #2
0
 private void AnticipatingBehaviour()
 {
     if (player != null)
     {
         Controller_Player p = player.GetComponent <Controller_Player>();
         agent.SetDestination(player.transform.position + p.GetLastAngle() * 2);
     }
 }
Example #3
0
 void Start()
 {
     parent = Controller_Player._Player;
     rb     = GetComponent <Rigidbody>();
     Restart._Restart.OnRestart += Reset;
     collider         = GetComponent <CapsuleCollider>();
     collider.enabled = false;
     going            = true;
 }
    private void Awake()
    {
        if (instance != null)
        {
            Destroy(this);
        }
        instance = this;

        m_Rig = GetComponent <Rigidbody>();
        m_Cam = Camera.main;
        m_Mat = GetComponent <Renderer>().material;

        Cursor.lockState = CursorLockMode.Confined;
    }
Example #5
0
    void setUpPlayer2()
    {
        TankData playerData = player2.GetComponent <TankData>();

        playerData.score  = p2Score;
        playerData.lives  = p2Lives;
        playerData.myName = "Player2";
        Controller_Player playerController = player2.GetComponent <Controller_Player>();

        if (p2Controller == 1)
        {
            playerController.selectedController = Controller_Player.controlType.arrows;
        }
    }
Example #6
0
    void setUpPlayer1()
    {
        TankData playerData = player1.GetComponent <TankData>();

        playerData.score  = p1Score;
        playerData.lives  = p1Lives;
        playerData.myName = "Player1";
        Controller_Player playerController = player1.GetComponent <Controller_Player>();

        if (p1Controller == 0)
        {
            playerController.selectedController = Controller_Player.controlType.wasd;
        }
    }
 private void Start()
 {
     sword.SetActive(false);
     shield.SetActive(false);
     if (_Player == null)
     {
         _Player = this.gameObject.GetComponent <Controller_Player>();
     }
     startPos = this.transform.position;
     rb       = GetComponent <Rigidbody>();
     render   = GetComponent <Renderer>();
     Restart._Restart.OnRestart += Reset;
     started = true;
     Controller_Shooting._ShootingPlayer.OnShooting += Shoot;
 }
Example #8
0
 private void Awake()
 {
     m_Player       = m_PlayerTransform.GetComponent <Controller_Player>();
     m_Cam          = transform.GetComponent <Camera>();
     m_OrgOrthoSize = m_Cam.orthographicSize;
 }
Example #9
0
 private void Awake()
 {
     script_controller      = GameObject.FindGameObjectWithTag(search_tag).GetComponent <Controller_Player>();
     ref_children_colliders = this.GetComponentsInChildren <Collider2D>();
 }
 private void Start()
 {
     m_PlayerRef = Controller_Player.instance;
     GetComponent <Renderer>().material.SetColor("_EmissionColor", Random.ColorHSV(0, 1, 1, 1, 1, 1));
 }
 public State_Grounded_Running(Controller_Player controller, StateMachine stateMachine, Rigidbody rb, Camera cam)
     : base(controller, stateMachine, rb, cam)
 {
     this.controller   = controller;
     this.stateMachine = stateMachine;
 }
Example #12
0
 public State(Controller_Player controller, StateMachine stateMachine)
 {
     this.controller   = controller;
     this.stateMachine = stateMachine;
 }