Example #1
0
    //        public List<ReflectScaleX> reflectScaleXList = new List<ReflectScaleX>();

    public void Init(GameObject obj)
    {
        _gameObject = obj;
        position    = _gameObject.transform.localPosition;
        scale       = _gameObject.transform.localScale;
        rotation    = _gameObject.transform.localRotation;
        //transformList = _gameObject.GetComponentsInChildren<Transform>(true).ToList();
        particleSystemList = _gameObject.GetComponentsInChildren <ParticleSystem>(true).ToList();
        animationList      = _gameObject.GetComponentsInChildren <Animation>(true).ToList();
        animatorList       = _gameObject.GetComponentsInChildren <Animator>(true).ToList();
        //spriteAnimationList = _gameObject.GetComponentsInChildren<SpriteAnimation>(true);
        ncCurveAnimationList       = _gameObject.GetComponentsInChildren <NcCurveAnimation>(true).ToList();
        ncSpriteAnimationList      = _gameObject.GetComponentsInChildren <NcSpriteAnimation>(true).ToList();
        ncUvAnimationList          = _gameObject.GetComponentsInChildren <NcUvAnimation>(true).ToList();
        particleSystemRendererList = _gameObject.GetComponentsInChildren <ParticleSystemRenderer>(true).ToList();
        skinnedMeshRendererList    = _gameObject.GetComponentsInChildren <SkinnedMeshRenderer>(true).ToList();
        meshRendererList           = _gameObject.GetComponentsInChildren <MeshRenderer>(true).ToList();
        ncEffectAniBehaviourList   = _gameObject.GetComponentsInChildren <NcEffectAniBehaviour>(true).ToList();
        delayList = _gameObject.GetComponentsInChildren <Delay>(true).ToList();

        ncRotationList = _gameObject.GetComponentsInChildren <NcRotation>(true).ToList();

        ncDuplicatorList = _gameObject.GetComponentsInChildren <NcDuplicator>(true).ToList();

        ncTrailTextureList = _gameObject.GetComponentsInChildren <NcTrailTexture>(true).ToList();
        //recordTransform();
        for (int i = 0; i < ncEffectAniBehaviourList.Count; i++)
        {
            NcEffectAniBehaviour ncEAB = ncEffectAniBehaviourList[i];
            ncEAB.isReuse = true;
            ncEAB.RecordStartState();
        }
    }
Example #2
0
    //
    //       [ContextMenu("RecordState")]
    public void RecordState()
    {
        // Profiler.BeginSample("effect desc");
        if (_hasInit)
        {
            // Profiler.EndSample();
            return;
        }

        _hasInit = true;
        for (int i = 0; i < ncEffectAniBehaviourList.Count; i++)
        {
            NcEffectAniBehaviour ncEAB = ncEffectAniBehaviourList[i];
            ncEAB.isReuse = true;
            ncEAB.RecordStartState();
        }
        for (int i = 0; i < ncDuplicatorList.Count; i++)
        {
            NcDuplicator ncd = ncDuplicatorList[i];
            ncd.effectObjectDescriptor = this;
            ncd.isReuse = true;
            ncd.RecordStartState();
        }
        for (int i = 0; i < ncRotationList.Count; i++)
        {
            NcRotation ncR = ncRotationList[i];
            ncR.isReuse = true;
            ncR.RecordStartState();
        }
        for (int i = 0; i < ncRotationList.Count; i++)
        {
            NcRotation ncR = ncRotationList[i];
            ncR.isReuse = true;
            ncR.RecordStartState();
        }
        for (int i = 0; i < ncTrailTextureList.Count; i++)
        {
            NcTrailTexture ncT = ncTrailTextureList[i];
            ncT.isReuse = true;
            ncT.RecordStartState();
        }
        // Profiler.EndSample();
    }