Пример #1
0
        public IGameObject FindGameObject(string name)
        {
            if (!_dicGameObjCache.ContainsKey(name))
            {
                var gameObject        = GameObject.Find(name);
                var gameObjectWrapper = new GameObjectWrapper(gameObject);

                _dicGameObjCache[name] = gameObjectWrapper;
            }

            return(_dicGameObjCache[name]);
        }
Пример #2
0
        public IGameObject Clone(IGameObject gameObject, string nameSuffix)
        {
            GameObjectWrapper retVal = null;

            if (gameObject is GameObjectWrapper)
            {
                var gameObjectWrapper = gameObject as GameObjectWrapper;
                var gameObjectUnity   = gameObjectWrapper.GameObject;

                var clone = Instantiate(gameObjectUnity);

                retVal = new GameObjectWrapper(clone);
                retVal.SourceGameObjectName = gameObjectUnity.name;
                retVal.Name += nameSuffix;

                _dicGameObjCache[retVal.Name] = retVal;
            }

            return(retVal);
        }