Beispiel #1
0
 public IAction this[HumanActions action]
 {
     get
     {
         IAction result;
         if (!this.actions.TryGetValue(action, out result))
         {
             result = NoAction.Instance;
         }
         return(result);
     }
     set
     {
         this.actions[action] = value;
     }
 }
Beispiel #2
0
    public void Start()
    {
        //Debug.Log (this.name + " Start()");

        //Assign variables
        _cam = Camera.main;

        humanActions = TournamentManager._instance.gameObject.AddComponent <HumanActions> ();
        humanActions.Init(this);

        //Spawn UI prefab for Human control
        _ui = Instantiate(Resources.Load("UI/UIHumanControl")) as GameObject;
        if (_ui != null)
        {
            _ui.GetComponent <UIHumanInput> ().SetLogicBase(this);
            _ui.GetComponent <UIHumanInput> ().Init(TournamentManager._instance.P1 == this as LogicBase ? true : false);
            _uiAnimator = _ui.GetComponent <Animator> ();
        }
        else
        {
            Debug.LogWarning("Could not spawn UI");
        }
    }