예제 #1
0
    IEnumerator Co_SetPlayerInvulnerableAfterDeath()
    {
        yield return(new WaitForEndOfFrame());

        Items.Inventory inventory = this.GetComponent <Items.Inventory>();

        inventory.PickSpecificItem(GameObject.FindObjectOfType <Items.ItemManager>().PickSpecificItem("Shield"));
        inventory.UseItem();
        this.transform.GetComponentInChildren <Items.Shield>().ChangeDuration(1.5f);
    }
예제 #2
0
    void Awake()
    {
        _rgbd2d  = GetComponent <Rigidbody2D>();
        _attacks = GetComponent <Attacks>();

        GameObject go = new GameObject();

        go.name             = "Controller";
        go.transform.parent = this.transform;

        _jsm = go.AddComponent <JoyStickManager>();
        _jsm.Reset(playerNumber - 1);

        _transform = this.GetComponent <Transform>();
        _anim      = this.GetComponent <Animator>();

        _inventory = this.GetComponent <Items.Inventory>();

        _movementBlocked = false;
        _movementSlowed  = false;
        _jumpBlocked     = false;
    }
예제 #3
0
 // Load from the default, for situations where we just want to reset.
 public static void LoadFromTemplate()
 {
     Inventory.InitializeFromDefault();
 }