Beispiel #1
0
    // Update is called once per frame
    void Update()
    {
        var newRegion = VisibilityManager.getRegion(transform);

        if (currentRegion != newRegion)
        {
            //Debug.Log("region updated");
            VisibilityManager.updateUnitRegion(this, newRegion);
            currentRegion = newRegion;
        }
    }
Beispiel #2
0
    public void initialize(Team t)
    {
        team = t;
        var o = Team.Blue;

        if (t == Team.Blue)
        {
            o = Team.Red;
        }
        setHostileTeam(VisibilityManager.getTeamMembers(o));
        VisibilityManager.addVisibleBehaviour(this);
        if (team == Team.Red)
        {
            GetComponent <Renderer>().material.color = Color.red;
        }
        else
        {
            GetComponent <Renderer>().material.color = Color.blue;
        }
        updateTeamBelonging();
        currentRegion = VisibilityManager.getRegion(transform);
        VisibilityManager.updateUnitRegion(this, currentRegion);
    }