Esempio n. 1
0
 //Send information of active enemies to the players
 public void UpdatePlayerEnemyLists()
 {
     foreach (KeyValuePair <int, GameObject> p in playerList)
     {
         PlayerSM psm = p.Value.GetComponent <PlayerSM>(); //obtain reference to each player's state machine
         psm.SetEnemyPool();
     }
 }
Esempio n. 2
0
 public PlayerRollState(GameObject t, PlayerSM playerSM, IControllerInput c) : base(t, playerSM, c)
 {
     this.target = t;
     this.sm     = playerSM;
     rb          = t.GetComponent <Rigidbody2D>();
     endtime     = ((PlayerSM)sm).pparams.rolltime;
     speed       = ((PlayerSM)sm).pparams.rollspeed;
     curve       = ((PlayerSM)sm).pparams.rollcurve;
 }
Esempio n. 3
0
 //constructor takes target game object, state machine running it, controller configuration, and arm gameobject for aiming
 public PlayerAimState(GameObject t, PlayerSM playerSM, IControllerInput c, GameObject a, GameObject g) : base(t, playerSM, c)
 {
     this.target = t;
     //Debug.Log("In stand state: " + target);
     this.sm          = playerSM;
     rb               = target.GetComponent <Rigidbody2D>();
     arm              = a;
     gun              = g;
     enemyList        = new List <GameObject>();
     lockOnResetLimit = playerSM.pparams.lockOnResetTime;
     lockResetTimer   = lockOnResetLimit + 1;
 }
Esempio n. 4
0
    private void Awake()
    {
        if (!instance)
        {
            instance = this;
            state    = 0;
        }
        else
        {
            Destroy(this);
        }

        scroller   = GameObject.Find("Scroll View").GetComponent <ScrollView>();
        mainCamera = Camera.main;
    }
 public PlayerRunState(PlayerSM playerSm)
 {
     _playerSM = playerSm;
 }
Esempio n. 6
0
 public PlayerLoseState(PlayerSM playerSM)
 {
     _playerSM = playerSM;
 }
Esempio n. 7
0
    float speed; //hardcoded movement speed placeholder

    public PlayerWalkState(GameObject t, PlayerSM playerSM, IControllerInput c, GameObject a, GameObject g) : base(t, playerSM, c, a, g)
    {
        speed = ((PlayerSM)sm).pparams.walkspeed; //fetch walk speed from player parameters asset
    }
Esempio n. 8
0
 public PlayerStandState(GameObject t, PlayerSM playerSM, IControllerInput c, GameObject a, GameObject g) : base(t, playerSM, c, a, g)
 {
 }
 public PlayerWinState(PlayerSM playerSM)
 {
     _playerSM = playerSM;
 }
Esempio n. 10
0
 public PlayerIdleState(PlayerSM playerSM)
 {
     _playerSM = playerSM;
 }
 public PlayerFightState(PlayerSM playerSM)
 {
     _playerSM = playerSM;
 }