Register() 공개 정적인 메소드

public static Register ( GameObject obj ) : void
obj GameObject
리턴 void
예제 #1
0
    public String spawnOverNetwork(String prefabName, Vector3 pos)
    {
        GameObject.Find("CrateGUI").GetComponent <CrateGUI>().IncrementCrateCount();

        GameObject temp = (GameObject)Network.Instantiate(Resources.Load(prefabName) as GameObject, pos, Quaternion.identity, 0);

        ObjectManager.Register(temp, "" + temp.GetHashCode());
        return("" + temp.GetHashCode());
    }
예제 #2
0
    void convert(GameObject first, GameObject second)
    {
        string firstID = ObjectManager.GetID(first);

        ObjectManager.Unregister(firstID);
        GameObject crate = (Instantiate(second, first.transform.position, first.transform.rotation) as GameObject);

        ObjectManager.Register(crate, firstID);

        crate.transform.position =
            new Vector3(crate.transform.position.x, Terrain.activeTerrain.SampleHeight(crate.transform.position), crate.transform.position.z);

        Destroy(first);
    }
예제 #3
0
    public void Init()
    {
        if (id.Equals(""))
        {
            ObjectManager.Register(gameObject);
            //id = gameObject.GetInstanceID().ToString();
        }
        else
        {
            ObjectManager.Register(gameObject, id);
        }



        junes = new Stack();
        enchantmentsRunning = new Stack();
        callbacks           = new Stack();


        if (audio_clip == null)
        {
            audio_clip = Resources.Load("SpellEffect") as AudioClip;
        }

        if (particles == null)
        {
            particles = Resources.Load("LightSparkles") as GameObject;
        }


        gameObject.AddComponent <Text3D>();

        if (do_restrictions)
        {
            gameObject.AddComponent <NoUnderground>();
            //gameObject.AddComponent<ScaleLimit>();
        }
        //gameObject.GetComponent<ScaleLimit>().upper_limit = 100;
        //gameObject.GetComponent<ScaleLimit>().lower_limit = 0;
    }
예제 #4
0
파일: GObject.cs 프로젝트: masums/gtk-core
 /// <summary>
 /// Registers an object to the ObjectManager.
 /// </summary>
 protected void RegisterObject()
 {
     ObjectManager.Register(handle, this);
 }