ObjectManager.Register C# (CSharp) Method

Register() public static method

public static Register ( GameObject obj ) : void
obj GameObject
return void
    public static void Register(GameObject obj)
    {
        //		Debug.Log("Enchantable: " + obj.name + " " + obj.GetInstanceID().ToString());
        //		FileLogger.Log("Enchantable: " + obj.name);

        try{
            objects.Add(obj.GetInstanceID().ToString(), obj);
        }catch(Exception e){
            Debug.Log("Could not register. " + e);
        }
    }

Same methods

ObjectManager::Register ( GameObject obj, string id ) : void

Usage Example

Esempio n. 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());
    }
All Usage Examples Of ObjectManager::Register