Example #1
0
    //选择职业
    //type == 0 :选择swordman
    //type == 1 :选择magicman
    public void ChooseCareer(int type)
    {
        my_Property = new Character_Property();
        GameObject man = GameObject.FindWithTag("Player");

        if (man != null)
        {
            Destroy(man.GetComponent <Character_Controller>());
            Destroy(man);
        }
        if (type == 1)
        {
            my_Property.career = Career.Magician;
            GameObject a = Instantiate(Resources.Load("Feiz/Magician")) as GameObject;
            Character_Controller.Instance.setCharacter(a);
        }
        else
        {
            my_Property.career = Career.Swordman;
            GameObject a = Instantiate(Resources.Load("Feiz/Swordman")) as GameObject;
            Character_Controller.Instance.setCharacter(a);
        }
        Init();
    }
 public void Property_Controller_Choose_Swordman()
 {
     my_Property = new Character_Property();
     GameObject man = GameObject.FindWithTag("Player");
     if (man != null)
     {
         GameObject.Destroy(man);
     }
         my_Property.career = Career.Swordman;
         GameObject a = Instantiate(Resources.Load("Feiz/Swordman")) as GameObject;
         Character_Controller.Instance.setCharacter(a);
     Property_Controller_Init();
 }