예제 #1
0
    public void PlayFx(string fxTag, Vector3 position, Quaternion rotation, Vector3 scale)
    {
        if (allFxDictionary.ContainsKey(fxTag))
        {
            FxObject fxObj = Instantiate(allFxDictionary[fxTag], position, rotation);
            fxObj.transform.localScale = scale;

            fxObj.PlayFx();
        }
    }
예제 #2
0
        public void AddChildGivesChildCorrectParent()
        {
            // arrange
            var child = new FxObject();

            var        type   = typeof(FxObject);
            var        parent = Activator.CreateInstance(type);
            MethodInfo method = type.GetMethod("AddChild", BindingFlags.NonPublic | BindingFlags.Instance);

            // act
            method.Invoke(parent, new object[] { child });

            // assert
            Assert.Same(child.Parent, parent);
        }