private void Start()
 {
     if (death == null)
     {
         death = FindObjectOfType <DeathData>();
     }
     if (demon == null)
     {
         demon = FindObjectOfType <DemonData>();
     }
     if (ghost == null)
     {
         ghost = FindObjectOfType <GhostData>();
     }
     if (grunt == null)
     {
         grunt = FindObjectOfType <GruntData>();
     }
     if (lobber == null)
     {
         lobber = FindObjectOfType <LobberData>();
     }
     if (sorcerer == null)
     {
         sorcerer = FindObjectOfType <SorcererData>();
     }
     if (thief == null)
     {
         thief = FindObjectOfType <ThiefData>();
     }
 }
Exemple #2
0
	public static Character Instantiate(Character prefab, int queuePosition, Transform queue, DemonData demonData, GameObject demonGO, Action callback) {
		var go = GameObject.Instantiate(prefab.gameObject) as GameObject;
		go.transform.localPosition = queue.position + Vector3.up * 10.0f;

		var character = go.GetComponent<Character>();
		character.animator = go.GetComponent<AnimateToPoint>();
		character.PositionInQueue(queue, queuePosition, callback);
		character.DemonData = demonData;
		character.miniPoofCloud.Play();

		character.demonGO = demonGO;
		demonGO.transform.parent = character.bigDemonRoot;
		demonGO.transform.localPosition = Vector3.zero;
		demonGO.SetActive(false);

		character.DemonAmount = 0.0f;

		var dgo = GameObject.Instantiate(demonData.ArtAsset) as GameObject;
		dgo.transform.parent = character.miniDemonRoot;
		dgo.transform.localPosition = Vector3.zero;

		character.sadRoot.gameObject.SetActive(false);
		character.happyRoot.gameObject.SetActive(false);
		character.ecstaticRoot.gameObject.SetActive(false);

		return character;
	}
Exemple #3
0
 // Use this for initialization
 void Start()
 {
     _dd       = DemonData.Instance;
     _animator = GetComponent <Animator>();
     PlayerAttack.Instance.OnPrimaryAttackHitListener.AddListener(OnPrimaryAttackHitCallBack);
     PlayerAttack.Instance.OnPrimaryAttackEndListener.AddListener(OnPrimaryAttackEndCallBack);
     _animParamHashFlinch  = Animator.StringToHash(_animParamFlinch);
     _animParamHashOverDie = Animator.StringToHash(_animParamOverDie);
     _animParamHashDie     = Animator.StringToHash(_animParamDie);
     _currentHealth        = _dd.maxHealth;
     _collider             = GetComponent <Collider>();
     _audioSource          = GetComponent <AudioSource>();
 }
	void UpdateDemon() {
		_currentDemon = _demons [_demonIndex];
		RemoveExistingDemonInstance ();
		InstantiateCurrentDemon ();
	}
Exemple #5
0
 void Awake()
 {
     s_instance = this;
 }