Ejemplo n.º 1
0
    public void TestAutoStart(PerformerTask autoStart)
    {
        PerformableTasks.Add(autoStart);

        if (!autoStart.Settings.AutoStart)
        {
            throw new System.Exception("The task '" + autoStart.GetType() + "' will not auto start because its data model has AutoStart set to false");
        }

        if (autoStart.Settings.Duration == 0)
        {
            throw new System.Exception("The test '" + autoStart.GetType() + "' will fail because its duratio is 0. Set it to something above 0");
        }

        if (autoStart.Performing)
        {
            Debug.Log("Auto Start test succeeded :)");
        }
        else
        {
            Debug.Log("Auto Start test failed :(");
        }
    }
Ejemplo n.º 2
0
        public void SetTask(PerformerTask task)
        {
            RemoveTask();
            currentTask               = ObjectPool.Instantiate(renderers[task.GetType()]).GetComponent <UnitRenderer> ();
            currentTask.Parent        = MyTransform;
            currentTask.LocalPosition = Vector3.zero;

            Vector3 originalScale = currentTask.LocalScale;

            currentTask.LocalScale = new Vector3(
                originalScale.x * 0.3f,
                originalScale.y * 0.3f,
                originalScale.z * 0.3f);
        }
Ejemplo n.º 3
0
    public void TestRepeat(PerformerTask repeat)
    {
        PerformableTasks.Add(repeat);
        repeat.onEnd += (PerformerTask task) => {
            Co2.WaitForFixedUpdate(() => {
                if (repeat.Performing)
                {
                    Debug.Log("Repeat test succeeded :)");
                }
                else
                {
                    Debug.Log("Repeat test failed :(");
                }
                repeat.Stop();
            });
        };

        if (!repeat.Settings.Repeat)
        {
            throw new System.Exception("The task '" + repeat.GetType() + "' will not repeat because its data model has Repeat set to false");
        }

        repeat.Start();
    }