예제 #1
0
    // Use this for initialization
    void Start()
    {
        theHeroMeleeSystem = GetComponent <MeleeScript>();
        #if UNITY_STANDALONE
        theHeroRangeSystem = GetComponent <HeroRangeScript>();
        //theAttackButton = GameObject.Find("AttackButton");
        //theAttackButton.SetActive(false);
        //ItemUI = GameObject.Find(m_ItemUI_Name);
        //Debug.Log("Item Canvas name: " + ItemUI.name);
        //ItemUI.gameObject.SetActive(false);
#else
        thePlayerJoystick = GameObject.FindObjectOfType <PlayerDrag>();
        //theAttackButton = GameObject.Find("AttackButton");
#endif
    }
예제 #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();
     }
 }