Esempio n. 1
0
    public Chara SpawnChar(CharaData.CharClassType classType,int charModelType,int camp,int level,Vector3 pos,Vector3 dir,CharaStatus.Pose pose)
    {
        this.START_METHOD("SpawnChar");
        Chara tempChar = null;
        if(classType==CharaData.CharClassType.CHARACTER)
        {

        }
        else if(classType==CharaData.CharClassType.BUILDING)
        {
            if((CharaData.buildingModel)charModelType==CharaData.buildingModel.BARRACK)
            {
                Barrack chara = new Barrack();//TODO: need change class to resource pool
                chara.SetPos(pos);
                chara.SetDir(dir);
                chara.SetCamp(camp);
                tempChar = chara;
            }
            if (tempChar != null)
                building.Add(tempChar);
            else
                throw new UnityException("no current building type to spawn!!");
        }

        allChara.Add(tempChar);
        this.END_METHOD("SpawnChar");
        return tempChar;
    }
Esempio n. 2
0
    public Chara SpawnChar(CharaData.CharClassType classType, int charModelType, int camp, int level, Vector3 pos, Vector3 dir, CharaStatus.Pose pose)
    {
        this.START_METHOD("SpawnChar");
        Chara tempChar = null;

        if (classType == CharaData.CharClassType.CHARACTER)
        {
        }
        else if (classType == CharaData.CharClassType.BUILDING)
        {
            if ((CharaData.buildingModel)charModelType == CharaData.buildingModel.BARRACK)
            {
                Barrack chara = new Barrack();//TODO: need change class to resource pool
                chara.SetPos(pos);
                chara.SetDir(dir);
                chara.SetCamp(camp);
                tempChar = chara;
            }
            if (tempChar != null)
            {
                building.Add(tempChar);
            }
            else
            {
                throw new UnityException("no current building type to spawn!!");
            }
        }

        allChara.Add(tempChar);
        this.END_METHOD("SpawnChar");
        return(tempChar);
    }