Beispiel #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();
        }
    }
Beispiel #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);
        }