Exemplo n.º 1
0
    public void DoCapture(HelperFunctions.Team toTeam, int amount)
    {
        if (toTeam == HelperFunctions.Team.Cube)
        {
            captureProgress += amount;
        }
        else if (toTeam == HelperFunctions.Team.Sphere)
        {
            captureProgress -= amount;
        }

        if (captureProgress == 0)
        {
            //Set to Neutral team
            state         = StateMachine.StatueState.Neutral;
            settings.team = HelperFunctions.Team.Neutral;
            SetVisualStatue();
        }
        else if (captureProgress == captureLimit)
        {
            //Set to Cube team
            state         = StateMachine.StatueState.Cube;
            settings.team = HelperFunctions.Team.Cube;
            SetVisualStatue();
        }
        else if (captureProgress == -captureLimit)
        {
            //Set to Sphere team
            state         = StateMachine.StatueState.Sphere;
            settings.team = HelperFunctions.Team.Sphere;
            SetVisualStatue();
        }
    }
Exemplo n.º 2
0
    //Positive capture side is for cube, negative is for sphere
    //When capping from enemy to yours, if you get prograss to 0
    // the statue will become neutral first

    private void Awake()
    {
        if (settings.team == HelperFunctions.Team.Cube)
        {
            state           = StateMachine.StatueState.Cube;
            captureProgress = captureLimit;
        }
        else if (settings.team == HelperFunctions.Team.Sphere)
        {
            state           = StateMachine.StatueState.Sphere;
            captureProgress = captureLimit * -1;
        }
        else
        {
            state = StateMachine.StatueState.Neutral;
        }

        SetVisualStatue();
    }