public override void Awake() { base.Awake(); sortingGroup = GetComponent <SortingGroup> (); type = FlashUtils.ClassType.MovieClip; FlashManager.getInstance().movieClipCount++; }
private void OnDestroy() { if (createOneByOne && FlashManager.getInstance() != null) { FlashManager.getInstance().frameUpdate -= frameUpdate; } }
//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. }
private void OnDestroy() { for (int _idx = 0; _idx < mainMovieClipList.Count; _idx++) { MovieClip _v2 = mainMovieClipList[_idx]; _v2.removeFromParent(); } mainMovieClipList.Clear(); _instance = null; }
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(); }
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; }
public override void OnDestroy() { spriteRenderer.sprite = null; FlashManager _flashManager = FlashManager.getInstance(); if (_flashManager != null) { _flashManager.spriteCount--; } base.OnDestroy(); }
public virtual void OnDestroy() { selfTrans = null; parentMovieClip = null; childInfo = null; propertyInFrames = null; FlashManager _flashManager = FlashManager.getInstance(); if (_flashManager != null) { _flashManager.displayObjectCount--; } }
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(); } } }
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(); }
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; } } }
// Start is called before the first frame update void Start() { Instance = this; }
public override void Awake() { base.Awake(); type = FlashUtils.ClassType.Sprite; FlashManager.getInstance().spriteCount++; }
public virtual void Awake() { selfTrans = transform; FlashManager.getInstance().displayObjectCount++; }