Ejemplo n.º 1
0
        private void PreloadDynamicObjectPrototypes()
        {
            this._preloadDynamicObjectProtos = new List <PreloadDynamicObjectPrototype>();
            ConfigDynamicObjectRegistry dynamicObjectRegistry = DynamicObjectData.GetDynamicObjectRegistry("Entities/DynamicObject/Data/DynamicObject_Level");

            for (int i = 0; i < dynamicObjectRegistry.entries.Length; i++)
            {
                DynamicObjectEntry entry = dynamicObjectRegistry.entries[i];
                this.PreloadDynamicObject(entry.name, entry.prefabPath);
            }
        }
Ejemplo n.º 2
0
        public Stone CreateStone(float createX, float createZ)
        {
            //	//
            GameObject prefab = Resources.Load <GameObject>(DynamicObjectData.GetResourcePath(DynamicObjectData.STONE_TYPE));

            ClientScene.RegisterPrefab(prefab);

            GameObject dynamicObjectView = GameObject.Instantiate(prefab) as GameObject;
            Stone      stone             = new Stone(dynamicObjectView, DynamicObjectData.STONE_TYPE, createX, createZ);

            _dynamicObjectList.Add(stone);

            NetworkServer.Spawn(dynamicObjectView);
            return(stone);
        }