Пример #1
0
 public override void Awake()
 {
     base.Awake();
     sortingGroup = GetComponent <SortingGroup> ();
     type         = FlashUtils.ClassType.MovieClip;
     FlashManager.getInstance().movieClipCount++;
 }
Пример #2
0
 private void OnDestroy()
 {
     if (createOneByOne && FlashManager.getInstance() != null)
     {
         FlashManager.getInstance().frameUpdate -= frameUpdate;
     }
 }
Пример #3
0
        //Create as a MainNode or not.
        public virtual void resetByTimeLineInfo(FlashUtils.MCTimeLineInfo mcTimeLineInfo_, MovieClip mainMovieClip_)
        {
            mcTimeLineInfo                = mcTimeLineInfo_;
            movieClipClassName            = mcTimeLineInfo.className;
            _childrenNeverRemoveFromStage = mcTimeLineInfo.childrenNeverRemoveFromStage;
            _allChildrenSprite            = mcTimeLineInfo.allChildrenSprite;
            _frameIntToFrameActionCache   = FlashUtils.getFrameIntToFrameActionCache(mcTimeLineInfo);
            _codeControlFrameAction       = new CodeControlFrameAction(FlashUtils.FrameNameType.none);

            if (mainMovieClip_ == null)
            {
                _isMainMovieClip = true;
                gameObject.name  = mcTimeLineInfo.className;
                spriteFromAltas  = true;
                setMainMovieClip(this);
                FlashManager.getInstance().mainMovieClipList.Add(this);
            }
            else
            {
                _isMainMovieClip = false;
                setMainMovieClip(mainMovieClip_);
            }

            if (_isMainMovieClip)
            {
                resetParsWhenOnOrOffStage(true);
            }

            if (_childrenNeverRemoveFromStage)         //Add all child to stage.
            {
                putAllChildOnStage();                  //Because there is no remove.
            }

            frameUpdate();              //Must do once frameUpdate.To move to frame 1 right now.
        }
Пример #4
0
 private void OnDestroy()
 {
     for (int _idx = 0; _idx < mainMovieClipList.Count; _idx++)
     {
         MovieClip _v2 = mainMovieClipList[_idx];
         _v2.removeFromParent();
     }
     mainMovieClipList.Clear();
     _instance = null;
 }
Пример #5
0
    public override void OnInspectorGUI()
    {
        FlashManager _flashManager = target as FlashManager;
        int          _frameRate    = EditorGUILayout.IntField("frameRate", _flashManager.frameRate);

        if (_flashManager.frameRate != _frameRate)
        {
            _flashManager.frameRate = _frameRate;
        }
        base.DrawDefaultInspector();
    }
Пример #6
0
 public FlashManager()
 {
     if (_instance != null)
     {
         Debug.LogError("ERROR " + System.Reflection.MethodBase.GetCurrentMethod().ReflectedType.FullName + " -> " + new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name + " : " +
                        "instance is already created."
                        );
     }
     _instance           = this;
     _updateIntervalTime = 1f / frameRate;
 }
Пример #7
0
        public override void OnDestroy()
        {
            spriteRenderer.sprite = null;
            FlashManager _flashManager = FlashManager.getInstance();

            if (_flashManager != null)
            {
                _flashManager.spriteCount--;
            }
            base.OnDestroy();
        }
Пример #8
0
        public virtual void OnDestroy()
        {
            selfTrans        = null;
            parentMovieClip  = null;
            childInfo        = null;
            propertyInFrames = null;
            FlashManager _flashManager = FlashManager.getInstance();

            if (_flashManager != null)
            {
                _flashManager.displayObjectCount--;
            }
        }
Пример #9
0
 private void Start()
 {
     if (string.IsNullOrEmpty(className))
     {
         transform.parent = null;
         Debug.LogError("ERROR " + System.Reflection.MethodBase.GetCurrentMethod().ReflectedType.FullName + " -> " + new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name + " : " +
                        "className IsNullOrWhiteSpace!"
                        );
     }
     else
     {
         if (FlashManager.getInstance() == null || !FlashManager.getInstance().initEnd)
         {
             FlashManager.beforeCreateList.Add(this);
         }
         else
         {
             createMovieClip();
         }
     }
 }
Пример #10
0
        public override void OnDestroy()
        {
            FlashManager _flashManager = FlashManager.getInstance();

            if (_flashManager != null)
            {
                _flashManager.mainMovieClipList.Remove(this);
            }
            if (_flashManager != null)
            {
                _flashManager.movieClipCount--;
            }
            _disOnStage.Clear();
            _disNotOnStage.Clear();
            _movieClipOnPathCache.Clear();
            _codeControlFrameAction     = null;
            frameLabelAtNextFrameBegin  = null;
            _mainMovieClip              = null;
            mcTimeLineInfo              = null;
            _frameIntToFrameActionCache = null;
            base.OnDestroy();
        }
Пример #11
0
    void Start()
    {
        _hideContainer        = new GameObject().transform;
        _hideContainer.parent = transform;
        _hideContainer.gameObject.SetActive(false);
        _hideContainer.gameObject.name = "hideContainer";

        if (changeHeadSkin && !string.Equals(movieClipClassName, "Animation_Frog"))
        {
            Debug.LogError("ERROR " + System.Reflection.MethodBase.GetCurrentMethod().ReflectedType.FullName + " -> " +
                           new System.Diagnostics.StackTrace().GetFrame(0).GetMethod().Name + " : " +
                           "changeHeadSkin only for 'Animation_Frog' in sample."
                           );
        }

        float _interval = _width / animationNumber;

        for (int _idx = 0; _idx < animationNumber; _idx++)
        {
            MovieClip _mainMovieClip = FlashUtils.getMovieClipByClassNameAndAddTo(movieClipClassName, transform);
            _mainMovieClip.selfTrans.localPosition   = new Vector3(_idx * _interval + _beginX, 0f, 0f);
            _mainMovieClip.currentAlpha              = alpha;
            _mainMovieClip.sortingGroup.sortingOrder = _idx;
            _mcList.Add(_mainMovieClip);
        }

        if (createOneByOne)
        {
            FlashManager.getInstance().frameUpdate += frameUpdate;
            for (int _idx = 0; _idx < _mcList.Count; _idx++)
            {
                _mcList[_idx].stop();
                _mcList[_idx].selfTrans.parent = _hideContainer;
            }
        }
    }
Пример #12
0
 // Start is called before the first frame update
 void Start()
 {
     Instance = this;
 }
Пример #13
0
 public override void Awake()
 {
     base.Awake();
     type = FlashUtils.ClassType.Sprite;
     FlashManager.getInstance().spriteCount++;
 }
Пример #14
0
 public virtual void Awake()
 {
     selfTrans = transform;
     FlashManager.getInstance().displayObjectCount++;
 }