示例#1
0
    private bool ChangeState()
    {
        var currentState = this.state;

        if (this.state != State.SHOOTING)
        {
            var shotDirection = this.hunterMovement.Sees(witchScent.CurrentCell.Value, raid: 6);
            if (shotDirection.HasValue)
            {
                this.witchShotDirection = shotDirection.Value;
                this.state = State.SHOOTING;
            }
            else if (this.hunterMovement.Hear(witchScent.CurrentCell.Value, raid: 8))
            {
                this.state = State.CHASING_WITCH;
            }
            else if (this.hunterMovement.Sees(cauldronScent.CurrentCell.Value, raid: 2).HasValue)
            {
                this.state = State.SEARCHING_RANDOMLY;
            }
            else
            {
                this.state = State.CHASING_CAULDRON;
            }
        }
        var changed = currentState != this.state;

        return(changed);
    }
示例#2
0
    public PremadeAnimation RunKnockback(CharMovement.Direction charDirection)
    {
        var forward   = CharMovement.GetDirectionVector(charDirection);
        var backwards = new Vector3(-forward.x, -forward.y, -forward.z);

        return(new AnimationChain(this, new List <PremadeAnimation> {
            new TranslateAnimation(this, backwards * DISTANCE, duration: DURATION / 2f),
            new TranslateAnimation(this, forward * DISTANCE, duration: DURATION / 2f)
        }).Start());
    }