Example #1
0
 // Use this for initialization
 void Start()
 {
     missions = FindObjectOfType<Missions>();
     animator = GetComponent<Animator>();
 }
Example #2
0
        public void Init()
        {
            _combat = transform.root.GetComponent<Combat> ();
            _multiplayerPlayerController = GetComponentInParent<MultiplayerPlayerController> ();
            PlayerObjectReferences playerObjects = GetComponentInParent<PlayerObjectReferences>();
            character = playerObjects.character.gameObject;

            if (_combat.isLocalPlayer) {
                enemyContainer.SetActive (false);
                container.SetActive (true);

                // set to 0 to fill niceley when starting
                _healthBarNewFill = 0.0f;
            } else {
                enemyContainer.SetActive (true);
                container.SetActive (false);
            }

            animator = GetComponent<Animator>();
            missions = FindObjectOfType<Missions>();

            missions.OnMissionStart += SetMissionDirector;
            missions.OnMissionEnd += DestroyMissionDirector;

            isInitialized = true;
        }