void OnDisable()
 {
     DirectorGuy.UnregisterSelf(this);
     Commander.UnregisterActor(this, 0);
     Commander.UnregisterActor(this, 1);
     Commander.UnregisterActor(this, 2);
 }
Ejemplo n.º 2
0
    public static void SetTime(float f)
    {
        f = Mathf.Clamp(f, 0f, 1f);
        int targetFrame = Mathf.FloorToInt(Mathf.Min(CommandHistory.Count - 1, f * CommandHistory.Count));

        for (int i = currentFrame; i != targetFrame; i += 0)
        {
            if (i > targetFrame)
            {
                i--;
                DirectorGuy.ForceUpdate(-1f);
                for (int j = 0; j < CommandHistory[i].Count; j++)
                {
                    UndoCommand(CommandHistory[i][j]);
                }
            }
            else if (i < targetFrame)
            {
                i++;
                DirectorGuy.ForceUpdate(1f);
                for (int j = 0; j < CommandHistory[i].Count; j++)
                {
                    IssueCommand(CommandHistory[i][j]);
                }
            }
            currentFrame = i;
        }
    }
 void OnEnable()
 {
     DirectorGuy.RegisterSelf(this);
     Commander.RegisterActor(this, 0);
     Commander.RegisterActor(this, 1);
     Commander.RegisterActor(this, 2);
     _camera        = Camera.main;
     _startPosition = transform.position;
 }
Ejemplo n.º 4
0
 void OnDisable()
 {
     DirectorGuy.UnregisterSelf(this);
 }
Ejemplo n.º 5
0
 void OnEnable()
 {
     DirectorGuy.RegisterSelf(this);
     startPosition = transform.position;
 }