Exemple #1
0
        public void OnEvent(EventType eventType)
        {
            var per = this.Controllor.Perception as BattlePerception;

            LastEvent = eventType;
            for (var index = 0; index < Magic.Containers.Count; index++)
            {
                var i = Magic.Containers[index];
                if (i.type == eventType)
                {
                    var timeLine = i.line == null?per.View.GetTimeLineByPath(i.layoutPath) : i.line;

                    var player = new TimeLinePlayer(timeLine, this, i);
                    _players.AddLast(player);
                    if (i.type == EventType.EVENT_START)
                    {
                        if (startLayout != null)
                        {
                            throw new Exception("Start layout must have one!");
                        }
                        startLayout = player;
                    }
                }
            }
        }
Exemple #2
0
    public override bool Act(TimeLinePlayer player)
    {
        player.buffer_Remove(this);

        CircleCollider2D[] ballsList;

        ballsList = player.GetComponentsInChildren <CircleCollider2D>();

        if (checkCondition == condition.BIGGER_THAN)
        {
            if (ballsList.Length > numberCheck)
            {
                if (if_TRUE.Length == 0)
                {
                    Debug.LogWarning("TimeLineObject Ball Check Condition doesn't have a 'if_TRUE' object. Condition will be ignored");
                }
                else
                {
                    player.buffer_Add(if_TRUE.ToArray());
                }

                return(true);
            }
        }
        else
        if (checkCondition == condition.SMALLER_THAN)
        {
            if (ballsList.Length < numberCheck)
            {
                if (if_TRUE.Length == 0)
                {
                    Debug.LogWarning("TimeLineObject Ball Check Condition doesn't have a 'if_TRUE' object. Condition will be ignored");
                }
                else
                {
                    player.buffer_Add(if_TRUE.ToArray());
                }

                return(true);
            }
        }

        if (if_TRUE.Length == 0)
        {
            Debug.LogWarning("TimeLineObject Ball Check Condition doesn't have a 'if_FALSE' object. Condition will be ignored");
        }
        else
        {
            player.buffer_Add(if_FALSE.ToArray());
        }

        return(true);
    }
Exemple #3
0
    public override bool Act(TimeLinePlayer player)
    {
        player.buffer_Remove(this);

        if (TimeLine.Length == 0)
        {
            Debug.LogError("TimeLineObject Wave does't have any TimeLineObject to play!");
            return(true);
        }

        player.buffer_Add(TimeLine.ToArray());

        return(true);
    }
Exemple #4
0
    public override bool Act(TimeLinePlayer player)
    {
        if (!prefab)
        {
            Debug.LogError("TimeLine_Object Random Area Spawn doesn't have a prefab do instantiate.");
            return(true);
        }

        float x = Random.Range(min_xPosition, max_xPosition);
        float y = Random.Range(min_yPosition, max_yPosition);

        Vector3 position = new Vector3(x, y);

        GameObject clone = Instantiate(prefab, position, player.transform.rotation, player.transform);

        return(clone != null);
    }
Exemple #5
0
    public override bool Act(TimeLinePlayer player)
    {
        if (ObjectsList.Length == 0)
        {
            Debug.LogError("TimeLineObject Random Object doesn't have any object to choose from!");
            return(true);
        }

        player.buffer_Remove(this);

        int rng = Random.Range(0, ObjectsList.Length);

        TimeLine_Object[] list = new TimeLine_Object[1];
        list[0] = ObjectsList[rng];

        player.buffer_Add(list);

        return(true);
    }
Exemple #6
0
        //----- method -----

        public override void OnBehaviourPause(Playable playable, FrameData info)
        {
            if (timeLinePlayer == null)
            {
                timeLinePlayer = UnityUtility.GetComponent <TimeLinePlayer>(PlayableDirector.gameObject);
            }

            if (LoopInfo == null)
            {
                return;
            }

            // この呼び出し内でLoopフラグが書き換わる.
            timeLinePlayer.CheckLoop(LoopInfo);

            if (!LoopInfo.Loop)
            {
                return;
            }

            PlayableDirector.time -= playable.GetDuration();
        }
Exemple #7
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();

        TimeLinePlayer myTarget = (TimeLinePlayer)target;

        myTarget.showPlayedWaves = EditorGUILayout.ToggleLeft("- Show played TimeLine Objects:  ", myTarget.showPlayedWaves);

        if (!myTarget.showPlayedWaves)
        {
            return;
        }

        for (int i = 0; i < myTarget.played_waves.Count; i++)
        {
            EditorGUILayout.LabelField(i + ". " + myTarget.played_waves[i].name, EditorStyles.miniLabel);
        }

        if (myTarget.waves_buffer == null)
        {
            return;
        }

        TimeLine_Object[] objectsList = new TimeLine_Object[myTarget.waves_buffer.Count];
        myTarget.waves_buffer.CopyTo(objectsList, 0);

        if (objectsList.Length > 0)
        {
            EditorGUILayout.LabelField(myTarget.played_waves.Count + ". " + "-> " + objectsList[0].name, EditorStyles.miniBoldLabel);

            for (int i = 1; i < objectsList.Length; i++)
            {
                EditorGUILayout.LabelField((myTarget.played_waves.Count + i) + ". " + objectsList[i].name);
            }
        }
    }
 public override void OnGraphStart(Playable playable)
 {
     TimeLinePlayer = GetTimeLinePlayer(playable);
 }
Exemple #9
0
 public override bool Act(TimeLinePlayer player)
 {
     return(player.time - player.lastActionTime > delay);
 }
Exemple #10
0
    public override bool Act(TimeLinePlayer player)
    {
        GameObject clone = Instantiate(prefab, position, player.transform.rotation, player.transform);

        return(clone != null);
    }
Exemple #11
0
 public abstract bool Act(TimeLinePlayer player);