示例#1
0
    private void MyInstantiate(long objGuid, GameObjInfo objInfo)
    {
        switch (objInfo.GameObjType)
        {
        case GameObjType.Prop:
            var i = Instantiate(propManager.PropMap(objInfo));
            props.TryAdd(objGuid, i.GetComponent <PropScript>());
            props[objGuid].Renew(objInfo);
            Debug.Log("生成了道具");
            break;

        case GameObjType.Character:
            var j = Instantiate(heroManager.HeroMap(objInfo));
            heros.TryAdd(objGuid, j.GetComponent <HeroScript>());
            heros[objGuid].Renew(objInfo);
            Debug.Log("生成了角色");
            break;

        case GameObjType.Bullet:
            var z = Instantiate(bulletManager.BulletMap(objInfo));
            bullets.TryAdd(objGuid, z.GetComponent <BulletScript>());
            bullets[objGuid].Renew(objInfo);
            Debug.Log("生成了子弹");
            break;

        case GameObjType.BirthPoint:
            Debug.Log("birthpoint......");
            break;

        case GameObjType.Wall:
            Debug.Log("wall......");
            break;

        case GameObjType.OutOfBoundBlock:
            Debug.Log("outofboundblock......");
            break;

        default: Debug.Log("abaabaabaaba"); break;
        }
    }