示例#1
0
    //// Use this for initialization
    //void Start () {

    //}

    public void pressedTheButtonScript()
    {
        // We shall cheat here becuz aint no time for SP!
        // So everytime we press a button, see whether Player GameoObject has exists!
        if (GameObject.FindGameObjectWithTag("Player") == null)
        {
            return;
        }

        if (thePlayerDrag == null)
        {
            thePlayerDrag = FindObjectOfType <PlayerDrag>();
        }
        switch (isOpeningInventory)
        {
        case true:
            if (LocalDataSingleton.instance.talking)
            {
                LocalDataSingleton.instance.Inventorycanvas.SetActive(!LocalDataSingleton.instance.Inventorycanvas.activeSelf);
                LocalDataSingleton.instance.talking = LocalDataSingleton.instance.Inventorycanvas.activeSelf;
                GameObject.FindGameObjectWithTag("Player").GetComponent <HeroesMovement>().stopMovement();
                isOpeningInventory = false;
                thePlayerDrag.playerHasPressedButton();
            }
            break;

        default:
            if (!LocalDataSingleton.instance.talking)
            {
                LocalDataSingleton.instance.Inventorycanvas.SetActive(!LocalDataSingleton.instance.Inventorycanvas.activeSelf);
                LocalDataSingleton.instance.talking = LocalDataSingleton.instance.Inventorycanvas.activeSelf;
                GameObject.FindGameObjectWithTag("Player").GetComponent <HeroesMovement>().stopMovement();
                thePlayerDrag.playerHasPressedButton();
                isOpeningInventory = true;
            }
            break;
        }
        //LocalDataSingleton.instance.talking = !LocalDataSingleton.instance.talking;
        //if (itemUI == null)
        //{
        //    itemUI = GameObject.Find(m_inventoryName);
        //}
        //itemUI.SetActive(LocalDataSingleton.instance.talking);
        //thePlayerDrag.playerHasPressedButton();
    }
示例#2
0
 public void pressedShoot()
 {
     //Debug.Log("Trying to shoot");
     if (!LocalDataSingleton.instance.talking)
     {
         if (heroRangeAttack == null)
         {
             //Debug.Log("Finding GameObject 1st");
             heroRangeAttack = GameObject.FindObjectOfType <HeroRangeScript>();
         }
         if (thePlayerJoystick == null)
         {
             thePlayerJoystick = GameObject.FindObjectOfType <PlayerDrag>();
         }
         thePlayerJoystick.playerHasPressedButton();
         heroRangeAttack.shootArrow();
     }
 }
示例#3
0
 public void doAttack()
 {
     if (thePlayerJoystick == null)
     {
         thePlayerJoystick = GameObject.FindObjectOfType <PlayerDrag>();
     }
     if (!LocalDataSingleton.instance.talking)
     {
         //thePlayerJoystick.fingerHasPressedIt = false;
         thePlayerJoystick.playerHasPressedButton();
         theHeroMeleeSystem.meleeAttack();
     }
     //else if (LocalDataSingleton.instance.InGamePauseCanvas.activeSelf)
     //{
     //    // If the in game pause is active and player hit the attack button, then use that button!
     //    LocalDataSingleton.instance.InGamePauseCanvas.GetComponentInChildren<InGamePauseScript>().selectedTheButton();
     //}
     GameObject.FindGameObjectWithTag("GameController").GetComponent <PlayerController>().TryInteract();
     MessageSystem.instance.triggerEventCall("PressedAndroidMeleeButton");
 }