示例#1
0
 //生成气泡,并创建动画,触发动画播放完成事件
 public void CreateBubble()
 {
     if (this.bubblePrefab != null)
     {
         //后面有bug。此处强制设置位置索引
         if (this.material == Material.XY || this.material == Material.XYL)
         {
             this.materialPanelIndex = 0;
         }
         GameObject bubble = Instantiate(this.bubblePrefab, this.transform) as GameObject;
         bubble.GetComponent <RectTransform>().anchoredPosition = Vector2.zero;
         dotweenPathABS = bubble.GetComponent <DOTweenPath>() as ABSAnimationComponent;
         this.dotweenPathABS.onComplete.AddListener(
             () =>
         {
             DOTweenPath dotweenPath = bubble.GetComponent <DOTweenPath>();
             Vector2 endPos          = new Vector2(materialPanelIndex * 123 + -397, -25);
             if (this.materialObj == null)
             {
                 this.materialObj = CreateMaterial(materialStartPos, endPos, false);
             }
             else
             {
                 CreateMaterial(materialStartPos, endPos, true);
             }
             Destroy(bubble);
         });
     }
 }
 //生成气泡,并创建动画,触发动画播放完成事件
 public void CreateBubble()
 {
     if (this.bubblePrefab != null)
     {
         if (this.countDown.enabled == false)
         {
             this.countDown.enabled = true;
         }
         GameObject bubble = Instantiate(this.bubblePrefab, this.transform) as GameObject;
         bubble.GetComponent <RectTransform>().anchoredPosition = Vector2.zero;
         dotweenPathABS = bubble.GetComponent <DOTweenPath>() as ABSAnimationComponent;
         this.dotweenPathABS.onComplete.AddListener(
             () =>
         {
             DOTweenPath dotweenPath = bubble.GetComponent <DOTweenPath>();
             Vector2 endPos          = new Vector2(materialPanelIndex * 123 + -397, -25);
             if (this.materialObj == null)
             {
                 //this.materialObj = CreateMaterial(materialStartPos, endPos, false);
                 this.materialObj = CreateMaterial(new Vector2(190, -332), endPos, false);
             }
             else
             {
                 //CreateMaterial(materialStartPos, endPos, true);
                 CreateMaterial(new Vector2(190, -332), endPos, true);
             }
             Destroy(bubble);
         });
     }
 }
示例#3
0
        private void OnEnable()
        {
            switch (this.onEnableBehaviour)
            {
            case OnEnableBehaviour.Play:
            {
                ABSAnimationComponent component = base.GetComponent <ABSAnimationComponent>();
                if ((Object)component != (Object)null)
                {
                    component.DOPlay();
                }
                break;
            }

            case OnEnableBehaviour.Restart:
            {
                ABSAnimationComponent component = base.GetComponent <ABSAnimationComponent>();
                if ((Object)component != (Object)null)
                {
                    component.DORestart(false);
                }
                break;
            }

            case OnEnableBehaviour.RestartFromSpawnPoint:
                this._requiresRestartFromSpawnPoint = true;
                break;
            }
        }
示例#4
0
 public static void AnimationEvents(ABSAnimationInspector inspector, ABSAnimationComponent src)
 {
     //IL_003a: Unknown result type (might be due to invalid IL or missing references)
     //IL_006f: Unknown result type (might be due to invalid IL or missing references)
     //IL_00a4: Unknown result type (might be due to invalid IL or missing references)
     //IL_00e9: Unknown result type (might be due to invalid IL or missing references)
     //IL_011e: Unknown result type (might be due to invalid IL or missing references)
     //IL_0153: Unknown result type (might be due to invalid IL or missing references)
     //IL_01b3: Unknown result type (might be due to invalid IL or missing references)
     //IL_01b8: Unknown result type (might be due to invalid IL or missing references)
     GUILayout.Space(6f);
     AnimationInspectorGUI.StickyTitle("Events");
     GUILayout.BeginHorizontal();
     src.hasOnStart  = DeGUILayout.ToggleButton(src.hasOnStart, new GUIContent("OnStart", "Event called the first time the tween starts, after any eventual delay"), ABSAnimationInspector.styles.button.tool, new GUILayoutOption[0]);
     src.hasOnPlay   = DeGUILayout.ToggleButton(src.hasOnPlay, new GUIContent("OnPlay", "Event called each time the tween status changes from a pause to a play state (including the first time the tween starts playing), after any eventual delay"), ABSAnimationInspector.styles.button.tool, new GUILayoutOption[0]);
     src.hasOnUpdate = DeGUILayout.ToggleButton(src.hasOnUpdate, new GUIContent("OnUpdate", "Event called every frame while the tween is playing"), ABSAnimationInspector.styles.button.tool, new GUILayoutOption[0]);
     GUILayout.EndHorizontal();
     GUILayout.BeginHorizontal();
     src.hasOnStepComplete = DeGUILayout.ToggleButton(src.hasOnStepComplete, new GUIContent("OnStep", "Event called at the end of each loop cycle"), ABSAnimationInspector.styles.button.tool, new GUILayoutOption[0]);
     src.hasOnComplete     = DeGUILayout.ToggleButton(src.hasOnComplete, new GUIContent("OnComplete", "Event called at the end of the tween, all loops included"), ABSAnimationInspector.styles.button.tool, new GUILayoutOption[0]);
     src.hasOnTweenCreated = DeGUILayout.ToggleButton(src.hasOnTweenCreated, new GUIContent("OnCreated", "Event called as soon as the tween is instantiated"), ABSAnimationInspector.styles.button.tool, new GUILayoutOption[0]);
     GUILayout.EndHorizontal();
     if (src.hasOnStart || src.hasOnPlay || src.hasOnUpdate || src.hasOnStepComplete || src.hasOnComplete || src.hasOnTweenCreated)
     {
         inspector.serializedObject.Update();
         DeGUILayout.BeginVBox(DeGUI.styles.box.stickyTop);
         if (src.hasOnStart)
         {
             EditorGUILayout.PropertyField(inspector.onStartProperty);
         }
         if (src.hasOnPlay)
         {
             EditorGUILayout.PropertyField(inspector.onPlayProperty);
         }
         if (src.hasOnUpdate)
         {
             EditorGUILayout.PropertyField(inspector.onUpdateProperty);
         }
         if (src.hasOnStepComplete)
         {
             EditorGUILayout.PropertyField(inspector.onStepCompleteProperty);
         }
         if (src.hasOnComplete)
         {
             EditorGUILayout.PropertyField(inspector.onCompleteProperty);
         }
         if (src.hasOnTweenCreated)
         {
             EditorGUILayout.PropertyField(inspector.onTweenCreatedProperty);
         }
         inspector.serializedObject.ApplyModifiedProperties();
         DeGUILayout.EndVBox();
     }
     else
     {
         GUILayout.Space(4f);
     }
 }
示例#5
0
        private void OnDisable()
        {
            this._requiresRestartFromSpawnPoint = false;
            switch (this.onDisableBehaviour)
            {
            case OnDisableBehaviour.Pause:
            {
                ABSAnimationComponent component = base.GetComponent <ABSAnimationComponent>();
                if ((Object)component != (Object)null)
                {
                    component.DOPause();
                }
                break;
            }

            case OnDisableBehaviour.Rewind:
            {
                ABSAnimationComponent component = base.GetComponent <ABSAnimationComponent>();
                if ((Object)component != (Object)null)
                {
                    component.DORewind();
                }
                break;
            }

            case OnDisableBehaviour.Kill:
            {
                ABSAnimationComponent component = base.GetComponent <ABSAnimationComponent>();
                if ((Object)component != (Object)null)
                {
                    component.DOKill();
                }
                break;
            }

            case OnDisableBehaviour.KillAndComplete:
            {
                ABSAnimationComponent component = base.GetComponent <ABSAnimationComponent>();
                if ((Object)component != (Object)null)
                {
                    component.DOComplete();
                    component.DOKill();
                }
                break;
            }

            case OnDisableBehaviour.DestroyGameObject:
            {
                ABSAnimationComponent component = base.GetComponent <ABSAnimationComponent>();
                if ((Object)component != (Object)null)
                {
                    component.DOKill();
                }
                Object.Destroy(base.gameObject);
                break;
            }
            }
        }
示例#6
0
 private void Update()
 {
     if (this._requiresRestartFromSpawnPoint)
     {
         this._requiresRestartFromSpawnPoint = false;
         ABSAnimationComponent component = base.GetComponent <ABSAnimationComponent>();
         if (component != null)
         {
             component.DORestart(true);
         }
     }
 }
示例#7
0
 public static void AnimationEvents(ABSAnimationInspector inspector, ABSAnimationComponent src)
 {
     GUILayout.Space(6f);
     AnimationInspectorGUI.StickyTitle("Events");
     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
     src.hasOnStart  = DeGUILayout.ToggleButton(src.hasOnStart, new GUIContent("OnStart", "Event called the first time the tween starts, after any eventual delay"), ABSAnimationInspector.styles.button.tool, new GUILayoutOption[0]);
     src.hasOnPlay   = DeGUILayout.ToggleButton(src.hasOnPlay, new GUIContent("OnPlay", "Event called each time the tween status changes from a pause to a play state (including the first time the tween starts playing), after any eventual delay"), ABSAnimationInspector.styles.button.tool, new GUILayoutOption[0]);
     src.hasOnUpdate = DeGUILayout.ToggleButton(src.hasOnUpdate, new GUIContent("OnUpdate", "Event called every frame while the tween is playing"), ABSAnimationInspector.styles.button.tool, new GUILayoutOption[0]);
     GUILayout.EndHorizontal();
     GUILayout.BeginHorizontal(new GUILayoutOption[0]);
     src.hasOnStepComplete = DeGUILayout.ToggleButton(src.hasOnStepComplete, new GUIContent("OnStep", "Event called at the end of each loop cycle"), ABSAnimationInspector.styles.button.tool, new GUILayoutOption[0]);
     src.hasOnComplete     = DeGUILayout.ToggleButton(src.hasOnComplete, new GUIContent("OnComplete", "Event called at the end of the tween, all loops included"), ABSAnimationInspector.styles.button.tool, new GUILayoutOption[0]);
     src.hasOnRewind       = DeGUILayout.ToggleButton(src.hasOnRewind, new GUIContent("OnRewind", "Event called when the tween is rewinded, either by playing it backwards until the end, or by rewinding it manually"), ABSAnimationInspector.styles.button.tool, new GUILayoutOption[0]);
     src.hasOnTweenCreated = DeGUILayout.ToggleButton(src.hasOnTweenCreated, new GUIContent("OnCreated", "Event called as soon as the tween is instantiated"), ABSAnimationInspector.styles.button.tool, new GUILayoutOption[0]);
     GUILayout.EndHorizontal();
     if (src.hasOnStart || src.hasOnPlay || src.hasOnUpdate || src.hasOnStepComplete || src.hasOnComplete || src.hasOnRewind || src.hasOnTweenCreated)
     {
         inspector.serializedObject.Update();
         DeGUILayout.BeginVBox(DeGUI.styles.box.stickyTop);
         if (src.hasOnStart)
         {
             EditorGUILayout.PropertyField(inspector.onStartProperty, new GUILayoutOption[0]);
         }
         if (src.hasOnPlay)
         {
             EditorGUILayout.PropertyField(inspector.onPlayProperty, new GUILayoutOption[0]);
         }
         if (src.hasOnUpdate)
         {
             EditorGUILayout.PropertyField(inspector.onUpdateProperty, new GUILayoutOption[0]);
         }
         if (src.hasOnStepComplete)
         {
             EditorGUILayout.PropertyField(inspector.onStepCompleteProperty, new GUILayoutOption[0]);
         }
         if (src.hasOnComplete)
         {
             EditorGUILayout.PropertyField(inspector.onCompleteProperty, new GUILayoutOption[0]);
         }
         if (src.hasOnRewind)
         {
             EditorGUILayout.PropertyField(inspector.onRewindProperty, new GUILayoutOption[0]);
         }
         if (src.hasOnTweenCreated)
         {
             EditorGUILayout.PropertyField(inspector.onTweenCreatedProperty, new GUILayoutOption[0]);
         }
         inspector.serializedObject.ApplyModifiedProperties();
         DeGUILayout.EndVBox();
         return;
     }
     GUILayout.Space(4f);
 }
 private void Awake()
 {
     this._animComponent = base.GetComponent <ABSAnimationComponent>();
 }
示例#9
0
 public static void DOKill(this ABSAnimationComponent @this)
 {
     // do nothing, why kill something? just let it finish animate?
 }