コード例 #1
0
    // Use this for initialization
    void Start()
    {
        textMesh = GetComponent <TextMesh>();

        ball = (BallBehaviourScript)GameObject.Find("Ball").GetComponent("BallBehaviourScript");

        Goals.Add(Team.Home, 0);
        Goals.Add(Team.Away, 0);

        Possession.Add(Team.Home, 0);
        Possession.Add(Team.Away, 0);

        Corners.Add(Team.Home, 0);
        Corners.Add(Team.Away, 0);

        ShotsOffTarget.Add(Team.Home, 0);
        ShotsOffTarget.Add(Team.Away, 0);
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        ball = (BallBehaviourScript)GameObject.Find("Ball").GetComponent("BallBehaviourScript");

        if (Team == Team.Home)
        {
            GetComponent <SpriteRenderer>().color = Color.red;

            if (Args.GameMode == GameMode.Play)
            {
                Controller = Controller.Human;
            }
        }
        else
        {
            GetComponent <SpriteRenderer>().color = Color.yellow;

            if (Args.GameMode == GameMode.Play)
            {
                Controller = Controller.Bot;
                LoadFromDisc(Application.dataPath + "/StreamingAssets/Teams/OpponentTeam");
            }
        }

        switch (Args.GameMode)
        {
        case GameMode.Play:
        case GameMode.Simple1v1Play:
        case GameMode.Simple1v1WithBall:
        case GameMode.Simple1v1WithoutBall:
        {
            ExtractorWithBall    = new Extractor1v1WithBall();
            ExtractorWithoutBall = new Extractor1v1WithoutBall();
        }
        break;
        }
    }