void Start()
 {
     UpdateWaterText();
     playerInventoryDisplay = GetComponent <PlayerInventoryDisplay>();
     // record position when scene starts
     startPosition = transform.position;
 }
Example #2
0
    // Use this for initialization
    void Start()
    {
        playerInventoryDisplay = GetComponent <PlayerInventoryDisplay>();
        playerInventoryDisplay.OnChangeInventory(items);

        //인벤토리 초기값 설정
        inventory_c.position = new Vector3(658.45f, 46.25f, 0);

        //아이템 이미지 체크x
        item_gun.gameObject.SetActive(false);
        item_key.gameObject.SetActive(false);
        item_pet.gameObject.SetActive(false);
    }
Example #3
0
    protected override void DoAction(Player player)
    {
        isUsed = true;
        transform.SetParent(null);
        PlayerStatsDisplay     display = PlayerStatsDisplay.Instance;
        PlayerInventoryDisplay inv     = PlayerInventoryDisplay.Instance;

        switch (pickup)
        {
        case PickupType.LIFE:
            player.Stats.AddToLife(amount);
            StartCoroutine(Util.FlyTo(renderer, this.gameObject, display.LifeIcon));
            break;

        case PickupType.POWER:
            player.Stats.AddToPower(amount);
            StartCoroutine(Util.FlyTo(renderer, this.gameObject, display.PowerIcon));
            break;

        case PickupType.DEFENSE:
            player.Stats.AddToDefense(amount);
            StartCoroutine(Util.FlyTo(renderer, this.gameObject, display.DefenseIcon));
            break;

        case PickupType.EXPERIENCE:
            player.Stats.AddToExperience(amount);
            StartCoroutine(Util.FlyTo(renderer, this.gameObject, display.ExperienceIcon));
            break;

        case PickupType.YELLOW_KEY:
            player.Keys.Yellow += amount;
            StartCoroutine(Util.FlyTo(renderer, this.gameObject, inv.GoldIcon));
            break;

        case PickupType.BLUE_KEY:
            player.Keys.Blue += amount;
            StartCoroutine(Util.FlyTo(renderer, this.gameObject, inv.BlueIcon));
            break;

        case PickupType.RED_KEY:
            player.Keys.Red += amount;
            StartCoroutine(Util.FlyTo(renderer, this.gameObject, inv.RedIcon));
            break;
        }
        enabled = false;
    }
Example #4
0
 //------------------------
 // cache a reference to the PlayerInventoryDisplay object
 // that is in the parent GameObject
 //
 // and then ensure UI display matches this initial state
 // of whether we are carrying a star or not
 void Start()
 {
     playerInventoryDisplay = GetComponent <PlayerInventoryDisplay>();
     playerInventoryDisplay.OnChangeCarryingStar(carryingStar);
 }
 void Start()
 {
     playerInventoryDisplay = GetComponent<PlayerInventoryDisplay>();
     playerInventoryDisplay.OnChangeInventory(inventory);
 }
 //------------------------
 // cache a reference to the PlayerInventoryDisplay object
 // that is in the parent GameObject
 //
 // and then ensure UI display matches this initial state
 // of whether we are carrying a star or not
 void Start()
 {
     playerInventoryDisplay = GetComponent<PlayerInventoryDisplay>();
     playerInventoryDisplay.OnChangeCarryingStar(carryingStar);
 }
Example #7
0
 void Start()
 {
     UpdatePattyText();
     playerInventoryDisplay = GetComponent <PlayerInventoryDisplay>();
 }
Example #8
0
    // Use this for initialization
    void Start()
    {
        playerInventoryDisplay = GetComponent <PlayerInventoryDisplay>();

        playerInventoryDisplay.OnChangeInventory(items);
    }
Example #9
0
 //-----------------------------
 void Start()
 {
     // get reference to instance of PlayerInventoryDisplay in parent GameObject
     playerInventoryDisplay = GetComponent<PlayerInventoryDisplay>();
 }
 //----------------------------------
 // get reference to display scripted instance object
 // and tell it to display the inital 'starTotal'
 void Start()
 {
     playerInventoryDisplay = GetComponent<PlayerInventoryDisplay>();
     playerInventoryDisplay.OnChangeStarTotal(starTotal);
 }
Example #11
0
 // Use this for initialization
 void Start()
 {
     playerInventoryDisplay = this.gameObject.GetComponent <PlayerInventoryDisplay>();
 }
Example #12
0
 private int totalStars = 0;     void Start()
 {
     playerInventoryDisplay = GetComponent <PlayerInventoryDisplay> ();
 }
Example #13
0
 void Start()
 {
     playerInventoryDisplay = GetComponent<PlayerInventoryDisplay>();
 }
Example #14
0
 private void Awake()
 {
     // Gets the player inventory display script component
     _playerInventoryDisplay = GetComponent <PlayerInventoryDisplay>();
 }
Example #15
0
 //------------------------
 // cache a reference to the PlayerInventoryDisplay object
 // that is in the parent GameObject
 void Awake()
 {
     playerInventoryDisplay = GetComponent <PlayerInventoryDisplay>();
 }
Example #16
0
 void Start()
 {
     playerInventoryDisplay = GetComponent <PlayerInventoryDisplay>();
 }
Example #17
0
 // Start is called just before any of the Update methods is called the first time
 void Start()
 {
     playerInventoryDisplay = GetComponent <PlayerInventoryDisplay>();
     playerInventoryDisplay.OnChangeStarTotal(starTotal);
 }
Example #18
0
 //-----------------------------
 void Start()
 {
     // get reference to instance of PlayerInventoryDisplay in parent GameObject
     playerInventoryDisplay = GetComponent <PlayerInventoryDisplay>();
 }