コード例 #1
0
        private FXUnit InternalSpawnAttached(FXSpawnerItem item)
        {
            var parent          = item.Parent == null ? transform : item.Parent;
            var fxUnit          = Instantiate(item.Unit, parent, false);
            var fxUnitTransform = fxUnit.transform;

            switch (item.Unit.SpawnScale)
            {
            case SpawnScale.IgnoreRelative:
                fxUnitTransform.localScale = Vector3.one;
                break;

            default:
            case SpawnScale.KeepRelative:
                break;
            }

            return(fxUnit);
        }
コード例 #2
0
        private FXUnit InternalSpawnPosition(FXSpawnerItem item)
        {
            var position        = item.Parent == null ? transform.position : item.Parent.position;
            var fxUnit          = Instantiate(item.Unit, position, item.Unit.transform.localRotation);
            var fxUnitTransform = fxUnit.transform;

            switch (item.Unit.SpawnScale)
            {
            case SpawnScale.IgnoreRelative:
                fxUnitTransform.localScale = Vector3.one;
                break;

            default:
            case SpawnScale.KeepRelative:
                break;
            }

            return(fxUnit);
        }