//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(); } }
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; }
//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; }
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; }
public PlayerLoseState(PlayerSM playerSM) { _playerSM = playerSM; }
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 }
public PlayerStandState(GameObject t, PlayerSM playerSM, IControllerInput c, GameObject a, GameObject g) : base(t, playerSM, c, a, g) { }
public PlayerWinState(PlayerSM playerSM) { _playerSM = playerSM; }
public PlayerIdleState(PlayerSM playerSM) { _playerSM = playerSM; }
public PlayerFightState(PlayerSM playerSM) { _playerSM = playerSM; }