コード例 #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();
     }
 }
コード例 #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;
 }
コード例 #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;
 }
コード例 #4
0
    private void Awake()
    {
        if (!instance)
        {
            instance = this;
            state    = 0;
        }
        else
        {
            Destroy(this);
        }

        scroller   = GameObject.Find("Scroll View").GetComponent <ScrollView>();
        mainCamera = Camera.main;
    }
コード例 #5
0
 public PlayerRunState(PlayerSM playerSm)
 {
     _playerSM = playerSm;
 }
コード例 #6
0
 public PlayerLoseState(PlayerSM playerSM)
 {
     _playerSM = playerSM;
 }
コード例 #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
    }
コード例 #8
0
 public PlayerStandState(GameObject t, PlayerSM playerSM, IControllerInput c, GameObject a, GameObject g) : base(t, playerSM, c, a, g)
 {
 }
コード例 #9
0
 public PlayerWinState(PlayerSM playerSM)
 {
     _playerSM = playerSM;
 }
コード例 #10
0
 public PlayerIdleState(PlayerSM playerSM)
 {
     _playerSM = playerSM;
 }
コード例 #11
0
 public PlayerFightState(PlayerSM playerSM)
 {
     _playerSM = playerSM;
 }