Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Q))
     {
         TemporalCrop derp = DataManager.Instance.SpawnObject <TemporalCrop, CropMomento>(obj1, this.transform.position, this.transform.rotation, Vector3.one);
         zip = derp.gameObject;
     }
     else if (Input.GetKeyDown(KeyCode.E))
     {
         DataManager.Instance.SpawnObject <TestObject, TestMomento>(obj2, this.transform.position, this.transform.rotation, Vector3.one);
     }
     else if (Input.GetKeyDown(KeyCode.X))
     {
         Debug.Log("huh?");
         DataManager.Instance.DestroyObject(zip);
     }
     else if (Input.GetKeyDown(KeyCode.V))
     {
         DataManager.Instance.SaveGameData();
     }
 }
Beispiel #2
0
    public override void ApplyMomentoData(object obj)
    {
        if (obj != null)
        {
            GameObject go = (GameObject)obj;
            if (go != null)
            {
                ResourceDependentCrop resourceComp = go.GetComponent <ResourceDependentCrop>();
                TemporalCrop          temporalComp = go.GetComponent <TemporalCrop>();

                if (resourceComp != null && temporalComp != null)
                {
                    temporalComp.TemporalLifetime = mTemporalLifetime;
                    temporalComp.TemporalTriggers = mTemporalTriggers;
                    resourceComp.MyResourceStore  = mResourceStore;
                    temporalComp.MeshArrayIndex   = mMeshArrayIndex;

                    base.ApplyMomentoData(resourceComp.gameObject);
                }
            }
        }
    }
Beispiel #3
0
    public override void UpdateMomentoData(object obj, string prefabName)
    {
        if (obj != null)
        {
            GameObject go = (GameObject)obj;
            if (go != null)
            {
                ResourceDependentCrop resourceComp = go.GetComponent <ResourceDependentCrop>();
                TemporalCrop          temporalComp = go.GetComponent <TemporalCrop>();

                if (resourceComp != null && temporalComp != null)
                {
                    mTemporalLifetime = temporalComp.TemporalLifetime;
                    mTemporalTriggers = temporalComp.TemporalTriggers;
                    mResourceStore    = resourceComp.MyResourceStore;
                    mMeshArrayIndex   = temporalComp.MeshArrayIndex;

                    base.UpdateMomentoData(go, prefabName);
                }
            }
        }
    }