Exemple #1
0
    private bool ValidatePrefab()
    {
        GameObject obj2;

        if (string.IsNullOrEmpty(this._sleepingAvatarPrefab))
        {
            return(false);
        }
        NetCull.PrefabSearch search = NetCull.LoadPrefab(this._sleepingAvatarPrefab, out obj2);
        if (((int)search) != 1)
        {
            Debug.LogError(string.Format("sleeping avatar prefab named \"{0}\" resulted in {1} which was not {2}(required)", this.prefab, search, NetCull.PrefabSearch.NGC));
            return(false);
        }
        IDMain component = obj2.GetComponent <IDMain>();

        if (!(component is SleepingAvatar))
        {
            Debug.LogError(string.Format("Theres no Sleeping avatar on prefab \"{0}\"", this.prefab), obj2);
            return(false);
        }
        this._hasInventory = component.GetLocal <Inventory>();
        TakeDamage local = component.GetLocal <TakeDamage>();

        this._hasTakeDamage  = (bool)local;
        this._takeDamageType = !this._hasTakeDamage ? null : local.GetType();
        return(true);
    }