예제 #1
0
    void Start()
    {
        currentWeapon = "purrete";

        /*
         * ////////////////////////////
         * Inventory.init();
         *
         * Item novaRopa = new Item("1", "nome", "ad", "ds", "roupa01", 100, 123, ItemType.Clothes);
         * Item arma1 = new Item("1", "nome", "ad", "ds", "arma04", 3, 123, ItemType.Weapon);
         * Item arma2 = new Item("2", "nome", "ad", "de", "arma05", 3, 123, ItemType.Weapon);
         *
         *
         * Clothes c = new Clothes();
         * Weapon a1 = new Weapon();
         * Weapon a2 = new Weapon();
         *
         * a1.init( arma1 );
         * a2.init( arma2 );
         * c.init ( novaRopa );
         *
         * Inventory.changeClothes ( c );
         * Inventory.addWeapon( a1 );
         * Inventory.addWeapon( a2 );
         *
         * ////////////////////////////
         */
        swapSetTexture(Inventory.getClothes().clothesItem.Image);
        swapWeaponTexture(Inventory.getWeapon().weaponItem.Image);
        SwapWeaponTextureInterface.checkTexture().SwapTexture(Inventory.getWeapon().weaponItem.Image);
    }
예제 #2
0
    void Update()
    {
        #region TOUCH INTERFACE_LAYER
        if (Input.touches.Length > 0)
        {
            foreach (Touch touch in Input.touches)
            {
                RaycastHit _hit;

                Ray _ray = Camera.main.ScreenPointToRay(touch.position);

                if (Physics.Raycast(_ray, out _hit, 100.0f))
                {
                    if (touch.phase == TouchPhase.Began)
                    {
                        if (_hit.collider.name == "ButtonPause")
                        {
                            Director.sharedDirector().Pause();
                            Director.sharedDirector().playEffect(audio);
                        }

                        if (_hit.collider.name == "arma01")
                        {
                            Director.sharedDirector().playEffect(button);
                            Inventory.changeWeapon();
                            SwapTextureInventory.checkSwap().swapWeaponTexture(Inventory.getWeapon().weaponItem.Image);
                            SwapWeaponTextureInterface.checkTexture().SwapTexture(Inventory.getWeapon().weaponItem.Image);

                            if (TutorialBehaviour.IndexTutorial == 4)
                            {
                                TutorialBehaviour.ActiveTutorial = true;
                            }
                        }
                    }
                }
            }
        }
        #endregion

        /*
         #region MOUSE CONTROL INTERFACE_LAYER
         * if(Input.GetMouseButtonDown(0)){
         *
         *      Ray _ray = Camera.main.ScreenPointToRay(Input.mousePosition);
         *
         *      RaycastHit _hit;
         *
         *      if(Physics.Raycast(_ray, out _hit, Mathf.Infinity)){
         *
         *              if(_hit.collider.name == "ButtonPause"){
         *
         *                      Director.sharedDirector().Pause();
         *                      Director.sharedDirector().playEffect(audio);
         *
         *              }
         *              if(_hit.collider.name == "arma01"){
         *
         *                      Director.sharedDirector().playEffect(button);
         *                      Inventory.changeWeapon();
         *                      SwapTextureInventory.checkSwap().swapWeaponTexture ( Inventory.getWeapon().weaponItem.Image );
         *                      SwapWeaponTextureInterface.checkTexture().SwapTexture ( Inventory.getWeapon().weaponItem.Image );
         *
         *                      if(TutorialBehaviour.IndexTutorial == 4)
         *                              TutorialBehaviour.ActiveTutorial = true;
         *
         *              }
         *      }
         * }
         #endregion*/
    }