Ejemplo n.º 1
0
 /*
  * Get SpriteRenderer, BattleNPC that owns this skill, & Bytes attached to skill
  * Disable this skill, until it is used
  */
 protected virtual void Awake()
 {
     SkillSpriteRenderer = GameGlobals.AttachCheckComponent <SpriteRenderer>(this.gameObject);
     SkillOwner          = GameGlobals.AttachCheckComponentParent <BattleNPC>(this.gameObject);
     m_ManagedBytes      = GetComponents <SkillByte>();
     ResetSkill();
 }
Ejemplo n.º 2
0
 // Use this for initialization
 void Awake()
 {
     m_Rigid2d         = GameGlobals.AttachCheckComponent <Rigidbody2D>(this.gameObject);
     m_ParentSkillByte = GameGlobals.AttachCheckComponentParent <ProjectileAttackByte>(this.gameObject);
     m_SpriteRenderer  = GameGlobals.AttachCheckComponent <SpriteRenderer>(this.gameObject);
     this.tag          = (BattleGlobals.IsHeroTeamTag(m_ParentSkillByte.ParentSkill.SkillOwner.tag)) ?
                         BattleGlobals.TAG_FOR_HERO_PROJ : BattleGlobals.TAG_FOR_ENEMY_PROJ;
     this.name = GameGlobals.TrimCloneFromName(this.name) +
                 "(" + m_ParentSkillByte.ParentSkill.SkillOwner + ")";
     // If the object is homing, this does not matter
     m_ProjDirection = (this.gameObject.CompareTag(BattleGlobals.TAG_FOR_HERO_PROJ)) ?
                       Vector2.left : Vector2.right;
     m_mainTarget = null;
 }