コード例 #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();
 }
コード例 #2
0
    protected override void Awake()
    {
        base.Awake();

        m_BeamStart = GameGlobals.AttachCheckComponent <SpriteRenderer>(
            Instantiate(beamStart, this.transform));
        m_BeamStart.color = beamColor;
        m_BeamStart.transform.localScale = m_BeamStart.transform.localScale * beamWidth;
        m_DefaultStartFlipX = m_BeamStart.flipX;

        m_BeamMiddle = GameGlobals.AttachCheckComponent <SpriteRenderer>(
            Instantiate(beamMiddle, this.transform));
        m_BeamMiddle.color = beamColor;
        m_BeamMiddle.transform.localScale = m_BeamMiddle.transform.localScale * beamWidth;

        m_BeamEnd = GameGlobals.AttachCheckComponent <SpriteRenderer>(
            Instantiate(beamEnd, this.transform));
        m_BeamEnd.color = beamColor;
        m_BeamEnd.transform.localScale = m_BeamEnd.transform.localScale * beamWidth;
        m_DefaultEndFlipX = m_BeamEnd.flipX;

        m_TargetMask = ((Target == TargetType.AnyTarget) || otherTeamBlocks) ?
                       BattleGlobals.GetBattleNPCLayerMask() : ((Target == TargetType.AlliedTargets) ?
                                                                BattleGlobals.GetAlliedLayerMask(ParentSkill.SkillOwner.tag) :
                                                                BattleGlobals.GetEnemyLayerMask(ParentSkill.SkillOwner.tag));
    }
コード例 #3
0
    }                                                   // BattleNPC buff is acting on

    protected virtual void Awake()
    {
        m_SpriteRenderer             = GameGlobals.AttachCheckComponent <SpriteRenderer>(this.gameObject);
        m_SpriteRenderer.enabled     = false;
        m_DegradeCount               = 1;
        m_CompletedBuffBytes         = 0;
        this.transform.localPosition = BUFF_SPRITE_LOCATION;
        m_EndBuffEarly               = false;
    }
コード例 #4
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;
 }
コード例 #5
0
    /*
     * Set our Parent(Skill)
     * Get OnCast & OnHit BuffControllers from 'buffs'
     */
    protected override void Awake()
    {
        // Normal "base.Awake()"
        ParentSkill = GameGlobals.AttachCheckComponent <Skill>(this.gameObject);

        OnCastBuffs = new List <BuffApplicator>();
        OnHitBuffs  = new List <BuffApplicator>();
        foreach (BuffConfiguration configuration in Buffs)
        {
            bool           onCastBuff = (configuration.BuffCastTime == BuffConfiguration.CastTimeType.OnSkillCast);
            BuffApplicator applicator = ScriptableObject.CreateInstance <BuffApplicator>();
            applicator.Initialize(configuration, ParentSkill.AffinityTypes, ParentSkill.SkillOwner);
            if (onCastBuff)
            {
                OnCastBuffs.Add(applicator);
            }
            else
            {
                OnHitBuffs.Add(applicator);
            }
        }
        //Do not call base.Awake(), differences are in the loop
    }
コード例 #6
0
    protected override void Awake()
    {
        MeleeCollider2D = GameGlobals.AttachCheckComponent <Collider2D>(this.gameObject);

        base.Awake();
    }
コード例 #7
0
 /*
  * Set our Parent(Skill)
  */
 protected virtual void Awake()
 {
     ParentSkill = GameGlobals.AttachCheckComponent <Skill>(this.gameObject);
 }