Beispiel #1
0
    public virtual bool Save(BinaryWriter writer)
    {
        string path = GameObjectPath.GetPath(base.transform);

        writer.Write(path);
        this.SaveTranData(writer);
        this.SaveTargetData(writer);
        return(true);
    }
Beispiel #2
0
    public virtual void ClearPrefab()
    {
        if (base.transform == null)
        {
            return;
        }
        string path = GameObjectPath.GetPath(base.transform);

        for (int i = 0; i < this.prefabObjs.Count; i++)
        {
            UnityEngine.Object @object = this.prefabObjs[i];
            if (@object != null)
            {
                Resources.UnloadAsset(@object);
            }
        }
        this.prefabObjs.Clear();
    }
Beispiel #3
0
    protected virtual void SaveTranData(BinaryWriter writer)
    {
        Transform transform = base.gameObject.GetModelObj(false).transform;

        try
        {
            writer.Write(transform.position.x);
            writer.Write(transform.position.y);
            writer.Write(transform.position.z);
            writer.Write(transform.rotation.w);
            writer.Write(transform.rotation.x);
            writer.Write(transform.rotation.y);
            writer.Write(transform.rotation.z);
            writer.Write(transform.gameObject.activeSelf);
        }
        catch (Exception ex)
        {
            string path = GameObjectPath.GetPath(base.transform);
            Debug.LogError("Error : " + path + " " + ex.ToString());
        }
    }