Exemple #1
0
        public void DeleteInstance()
        {
            if (go != null)
            {
                Debug.Log(String.Format("KramaxPluginReload.PluginClass.DeleteInstance {0} being destroyed.", Name));

                UnityEngine.GameObject.DestroyImmediate(go);
                go       = null;
                instance = null;
                fired    = false;
                alive    = false;
            }
            else
            {
                Debug.Log(String.Format("KramaxPluginReload.PluginClass.DeleteInstance object {0} is not alive.", Name));
            }
        }
        public void DeleteInstance()
        {
            if (go != null)
            {
                Debug.Log(String.Format("KramaxPluginReload.PluginClass.DeleteInstance {0} being destroyed.", Name));

                UnityEngine.GameObject.DestroyImmediate(go);
                go = null;
                instance = null;
                fired = false;
                alive = false;
            }
            else
            {
                Debug.Log(String.Format("KramaxPluginReload.PluginClass.DeleteInstance object {0} is not alive.", Name));
            }
        }
Exemple #3
0
        public void CreateInstance()
        {
            if (go != null || instance != null)
            {
                Debug.LogError(String.Format("KramaxPluginReload.PluginClass.CreateInstance object {0} already alive.", Name));
                return;
            }

            Debug.Log(String.Format("KramaxPluginReload.PluginClass.CreateInstance create object {0}.", Name));

            go                   = new GameObject(type.Name);
            instance             = go.AddComponent(type) as KramaxReloadExtensions.ReloadableMonoBehaviour;
            instance.typeMapping = typeMapping;

            fired = true;
            alive = true;
        }
        public void CreateInstance()
        {
            if (go != null || instance != null)
            {
                Debug.LogError(String.Format("KramaxPluginReload.PluginClass.CreateInstance object {0} already alive.", Name));
                return;
            }

            Debug.Log(String.Format("KramaxPluginReload.PluginClass.CreateInstance create object {0}.", Name));

            go = new GameObject(type.Name);
            instance = go.AddComponent(type) as KramaxReloadExtensions.ReloadableMonoBehaviour;
            instance.typeMapping = typeMapping;

            fired = true;
            alive = true;
        }