Example #1
0
        public void SetExposedReferenceOfScriptableObject()
        {
            SimpleExposedPropertyTable propTable = CreatePropertyTableGameObject();
            DummyScriptableObject      obj       = ScriptableObject.CreateInstance <DummyScriptableObject>();

            GameObject fooGameObject = new GameObject("Foo");

            ExposedReferenceUtility.SetReferenceValueInEditor(ref obj.exposedGameObject, propTable, fooGameObject);

            GameObject resolvedGameObject = obj.exposedGameObject.Resolve(propTable);

            Assert.AreEqual(fooGameObject, resolvedGameObject);

            Object.DestroyImmediate(obj);
        }
Example #2
0
        public void TestDuplicatedExposedReferenceAreNotLinked()
        {
            SimpleExposedPropertyTable propTable = CreatePropertyTableGameObject();
            DummyScriptableObject      obj0      = ScriptableObject.CreateInstance <DummyScriptableObject>();

            GameObject fooGameObject = new GameObject("Foo");

            ExposedReferenceUtility.SetReferenceValueInEditor(ref obj0.exposedGameObject, propTable, fooGameObject);

            //Duplicate
            DummyScriptableObject obj1          = Object.Instantiate(obj0);
            GameObject            barGameObject = new GameObject("Bar");

            ExposedReferenceUtility.RecreateReferenceInEditor(ref obj1.exposedGameObject, propTable);
            Assert.AreEqual(obj0.exposedGameObject.Resolve(propTable), obj1.exposedGameObject.Resolve(propTable));

            //Change value
            ExposedReferenceUtility.SetReferenceValueInEditor(ref obj1.exposedGameObject, propTable, barGameObject);
            Assert.AreNotEqual(obj0.exposedGameObject.Resolve(propTable), obj1.exposedGameObject.Resolve(propTable));

            Object.DestroyImmediate(obj1);
            Object.DestroyImmediate(obj0);
        }
Example #3
0
 private void SetExtractedSceneCachePlayerInEditor(SceneCachePlayer scPlayer)
 {
     ExposedReferenceUtility.SetReferenceValueInEditor(ref m_extractedSceneCachePlayerRef, m_propertyTable, scPlayer);
 }
Example #4
0
 internal void SetSceneCachePlayerInEditor(SceneCachePlayer scPlayer)
 {
     ExposedReferenceUtility.SetReferenceValueInEditor(ref m_sceneCachePlayerRef, m_propertyTable, scPlayer);
 }