ObjectManager.FindById C# (CSharp) Method

FindById() public static method

public static FindById ( string id ) : GameObject
id string
return GameObject
    public static GameObject FindById(string id)
    {
        return objects[id];
    }

Usage Example

Esempio n. 1
0
    public void castSpell(GameObject target)
    {
        if (target.GetComponent("Enchantable") == null)
        {
            TraceLogger.LogKVtime("attempt", getSpellName());
            TraceLogger.LogKV("target", target.GetInstanceID().ToString() + ", " + target.name + ", " + target.transform.position);
            TraceLogger.LogKV("player", "" + ObjectManager.FindById("Me").transform.position);
            (GameObject.Find("Popup").GetComponent("Popup") as Popup).popup("Target (" + target.name + ") immune to magic.");
            SetHidden(false);
            return;
        }

        TraceLogger.LogKVtime("spell", getSpellName());
        ProgramLogger.LogKVtime("spell", getSpellName());
        TraceLogger.LogKV("target", target.GetInstanceID().ToString() + ", " + target.name + ", " + target.transform.position);
        TraceLogger.LogKV("player", "" + ObjectManager.FindById("Me").transform.position);

        June june = new June(target, file_name);

        SetHidden(false);

        item_name = "Blank";
        file_name = "";
        animate   = false;


        inventoryTexture = Resources.Load("Textures/Scroll") as Texture2D;


        (target.GetComponent("Enchantable") as Enchantable).enchant(june, delegate(GameObject t){ absorbSpell(t); });
    }
All Usage Examples Of ObjectManager::FindById