Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (this.state == ArenaGateState.Closing)
     {
         animationTimer += Time.deltaTime;
         var proc = animationTimer / closeSpeed;
         if (proc >= 1)
         {
             proc       = 1f;
             this.state = ArenaGateState.Closed;
         }
         this.transform.localPosition = Vector3.Lerp(openState, closedState, proc);
     }
     else if (this.state == ArenaGateState.Opening)
     {
         animationTimer += Time.deltaTime;
         var proc = animationTimer / closeSpeed;
         if (proc >= 1)
         {
             proc       = 1f;
             this.state = ArenaGateState.Open;
         }
         this.transform.localPosition = Vector3.Lerp(closedState, openState, proc);
     }
 }
Exemplo n.º 2
0
    public void Close()
    {
        if (this.state == ArenaGateState.Closed)
        {
            return;
        }

        this.animationTimer = 0;
        this.state          = ArenaGateState.Closing;
    }
Exemplo n.º 3
0
    public void Open()
    {
        if (this.state == ArenaGateState.Open)
        {
            return;
        }

        this.animationTimer = 0;
        this.state          = ArenaGateState.Opening;
    }
Exemplo n.º 4
0
    public void Close()
    {
        if (state == ArenaGateState.Closed)
        {
            return;
        }

        animationTimer = 0;
        state          = ArenaGateState.Closing;
    }
Exemplo n.º 5
0
    public void Open()
    {
        if (state == ArenaGateState.Open)
        {
            return;
        }

        animationTimer = 0;
        state          = ArenaGateState.Opening;
    }