示例#1
0
        /// <summary>
        /// Registers the AI in the level and finds the other players.
        /// </summary>
    	private void Start() {
            bard = GetComponent<AIBard>();
            control = GetComponent<AIControl>();
            enabledRhythms = LevelManager.instance.EnabledRhythms;
            LevelControllerManager.instance.AddPlayer(control.player, control);
            bard.timingVariance = 0.1f;

            MinionTuneSpawn minion = GetComponent<MinionTuneSpawn>();
            PlayerID selfID;
            if (minion != null) {
                selfID = minion.owner;
            } else {
                selfID = control.player;
            }

            otherPlayers = new List<BaseControl>();
            BaseControl[] otherPlayersArray = FindObjectsOfType<BaseControl>();
            foreach (BaseControl otherPlayer in otherPlayersArray) {
                if (otherPlayer.player != selfID && otherPlayer.GetComponent<MinionTuneSpawn>() == null) {
                    otherPlayers.Add(otherPlayer);
                }
            }

            InitializeAI();
    	}
示例#2
0
 /// <summary>
 /// Generates random tunes for the bard if needed.
 /// </summary>
 private void Awake()
 {
     bard = GetComponent <AIBard>();
     bard.RandomizeTunes();
 }