示例#1
0
        public void Play(object target)
        {
            Configure(target);

            TweenBase tb = _tween as TweenBase;
            Tween     t  = _tween as Tween;

            if (null != t)
            {
                t.Easer = Easer;
            }

            if (null != tb)
            {
                tb.Play(target);
            }
        }
示例#2
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        TweenBase tweenClass = (TweenBase)target;

        if (GUILayout.Button("Play"))
        {
            tweenClass.Play();
            return;
        }
        if (GUILayout.Button("ReversePlay"))
        {
            tweenClass.ReversePlay();
            return;
        }
        if (GUILayout.Button("Reset"))
        {
            tweenClass.Init();
            return;
        }
    }
示例#3
0
    public void PressOnPosition(int row, int column, GameManager.Players player)
    {
        //Debug.Log( string.Format( "We pressed on the position ({0},{1})", row, column ) );

        // Calculate the position
        Vector3 position = grid[row, column].transform.localPosition * rotationForce;
        //Debug.Log( string.Format( "Original position ({0},{1},{2})", position.x, position.y, position.z ) );

        // For some reason I have to "rotate" the X and Y axis for it to properly align with the model
        Vector3 correctedPosition = Quaternion.Euler(0, 90, 0) * position;

        // Debug.Log( string.Format( "Corrected position ({0},{1},{2})", correctedPosition.x, correctedPosition.y, correctedPosition.z ) );

        // Apply the torque
        model.AddTorque(correctedPosition);

        // Set grid place
        grid[row, column].Set(player);

        // Play effects
        PlaySoundExplosion();
        grid[row, column].PlayEffects();
        tweenShake.Play();

        // I-ll save this snippet for special considerations
        //switch (row)
        //{
        //    default:
        //    case 1:
        //        if (column == 1)
        //        {
        //        }
        //        break;
        //    case 2:
        //        break;
        //    case 3:
        //        break;
        //}
    }
 public bool Destory()
 {
     OverlapNumber--;
     if (OverlapNumber > 0)
     {
         //如果还有相同ID 的buff。需要在此buff销毁后,重新替换一个相同ID的buff
         if (buff.pendingDestroy || buff.destroyed)
         {
             buff = creature.GetBuffList().Find(item => item.ID == buffID && !item.pendingDestroy && !item.destroyed);
         }
         return(false);
     }
     if (!destoryTween)
     {
         GameObject.Destroy(this.gameObject);
     }
     else
     {
         destoryTween.onComplete.AddListener((b) => Destroy(gameObject));
         destoryTween.Play();
     }
     return(true);
 }
示例#5
0
        /// <summary>
        /// インスペクター表示
        /// </summary>
        public override void OnInspectorGUI()
        {
            EditorGUI.BeginDisabledGroup(true);
            EditorGUILayout.PropertyField(serializedObject.FindProperty("m_Script"));
            EditorGUI.EndDisabledGroup();

            serializedObject.Update();
            EditorGUILayout.BeginVertical(GUI.skin.box);
            {
                EditorGUIUtility.labelWidth = 80;

                EditorGUILayout.PropertyField(_group_name, new GUIContent(_group_name.displayName.Replace("_", " ")));

                DrawLine(Color.black);

                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.PropertyField(_type);
                    ToggleLeftPropertyField(_is_reverse, "逆再生するならtrue", GUILayout.MaxWidth(100));
                    EditorGUILayout.EndHorizontal();
                }

                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.LabelField("", GUILayout.Width(80));
                    ToggleLeftPropertyField(_is_ignore_timescale, "タイムスケールを無視するならtrue");
                    ToggleLeftPropertyField(_is_fixedtime, "物理フレームで動作するならtrue");
                    EditorGUILayout.EndHorizontal();
                }

                {
                    EditorGUILayout.BeginHorizontal();
                    EditorGUILayout.PropertyField(_delay);
                    EditorGUILayout.PropertyField(_duration);
                    EditorGUILayout.EndHorizontal();
                }

                DrawLine(Color.black);

                {
                    if (_from != null)
                    {
                        EditorGUILayout.PropertyField(_from);
                    }
                    if (_to != null)
                    {
                        EditorGUILayout.PropertyField(_to);
                    }
                    if (_option != null)
                    {
                        EditorGUILayout.PropertyField(_option);
                    }
                }

                EditorGUILayout.PropertyField(_curve, GUILayout.Height(50));
                EditorGUILayout.PropertyField(_on_finished, new GUIContent(_on_finished.displayName.Replace("_", " ")));
            }
            EditorGUILayout.EndVertical();
            serializedObject.ApplyModifiedProperties();

            // 実行中のみテスト機能を有効化
            if (Application.isPlaying)
            {
                DrawLine(Color.black);
                {
                    GUILayout.BeginHorizontal();
                    if (GUILayout.Button("Replay", GUILayout.Width(80)))
                    {
                        TweenBase tween = target as TweenBase;
                        if (_is_test_with_child)
                        {
                            TweenBase[] tweens = tween.transform.GetTweens(_test_groupname);
                            tweens.Play();
                        }
                        else
                        {
                            tween.Play(tween.isReverse);
                        }
                    }
                    _is_test_with_child = GUILayout.Toggle(_is_test_with_child, "WithChild", GUILayout.Width(100));
                    GUI.enabled         = _is_test_with_child;
                    _test_groupname     = GUILayout.TextField(_test_groupname);
                    GUI.enabled         = true;
                    GUILayout.EndHorizontal();
                }
            }
        }
示例#6
0
 public void CloseTip()
 {
     closeTween.Play(CloseTipImmediately);
 }
 public void OnTrigger()
 {
     activeTween?.Play();
 }