Ejemplo n.º 1
0
 /*(public static WarriorPlayer Instance {//this and awake make warrior a singleton
     get {
         if (wp == null) {
             wp = FindObjectOfType<WarriorPlayer> ();
             if (wp == null) {
                 GameObject obj = new GameObject ();
                 obj.hideFlags = HideFlags.HideAndDontSave;
                 wp = obj.AddComponent<WarriorPlayer> ();
             }
         }
         return wp;
     }
 }*/
 void Awake()
 {
     //DontDestroyOnLoad (this.gameObject);
     if (wp == null) {
         wp = this;
         SetMaxHealth(100);
         SetHealth(GetMaxHealth());
         SetSpeed(75);
         AddOffensiveAbility (new StunSmashS());
         AddOffensiveAbility (new DoubleStrikeS ());
         SetShield (ElementType.NONE);
         SetShield (ElementType.NONE);
     } else {
         Destroy (gameObject);
     }
 }
Ejemplo n.º 2
0
    /*(public static WarriorPlayer Instance {//this and awake make warrior a singleton
     *      get {
     *              if (wp == null) {
     *                      wp = FindObjectOfType<WarriorPlayer> ();
     *                      if (wp == null) {
     *                              GameObject obj = new GameObject ();
     *                              obj.hideFlags = HideFlags.HideAndDontSave;
     *                              wp = obj.AddComponent<WarriorPlayer> ();
     *                      }
     *              }
     *              return wp;
     *      }
     * }*/

    void Awake()
    {
        //DontDestroyOnLoad (this.gameObject);
        if (wp == null)
        {
            wp = this;
            SetMaxHealth(100);
            SetHealth(GetMaxHealth());
            SetSpeed(75);
            AddOffensiveAbility(new StunSmashS());
            AddOffensiveAbility(new DoubleStrikeS());
            SetShield(ElementType.NONE);
            SetShield(ElementType.NONE);
        }
        else
        {
            Destroy(gameObject);
        }
    }
 void Start()
 {
     sceneNavigator = (SceneNavigator)FindObjectOfType<SceneNavigator> ();
     wp = (WarriorPlayer)FindObjectOfType<WarriorPlayer> ();
     SetUpButtons ();
 }
Ejemplo n.º 4
0
 void Start()
 {
     sceneNavigator = (SceneNavigator)FindObjectOfType <SceneNavigator> ();
     wp             = (WarriorPlayer)FindObjectOfType <WarriorPlayer> ();
     SetUpButtons();
 }