コード例 #1
0
        public override void Launch()
        {
            StunStatus stun;
            Unit       enemyUnit;

            foreach (RaycastHit hit in Physics.BoxCastAll(spellIndicator.transform.position, new Vector3(spellRange, 2f, 4f), Vector3.up))
            {
                if (hit.collider.tag != this.tag && (enemyUnit = hit.collider.GetComponent <Unit>()) != null)
                {
                    stun          = new StunStatus();
                    stun.duration = stunDuration;
                    stun.Init(enemyUnit);
                }
            }
            if (slowStatus != null)
            {
                slowStatus.OnStatusEnd(unit.GetComponent <Unit>());
                slowStatus = null;
            }
            base.Launch();
            Transform spellOrigin = unit.GetComponent <ControllableUnit>().spellOrigin;

            spellVisual = Instantiate(visualEffectRef, spellOrigin.position, spellOrigin.rotation);
            Invoke("Clean", 0.2f);
        }
コード例 #2
0
ファイル: UnitStatus.cs プロジェクト: MaiDaine/Prototype
        public static UnitStatus CreateFromType(statusTypes type, float duration, float power)
        {
            UnitStatus tmp = null;

            switch (type)
            {
            case statusTypes.Stun:
                tmp = new StunStatus();
                break;

            case statusTypes.Root:
                tmp = new RootStatus();
                break;

            case statusTypes.Speed:
                tmp = new SpeedStatus();
                ((SpeedStatus)tmp).speedModifier = power;
                break;
            }
            if (tmp != null)
            {
                tmp.duration = duration;
            }
            return(tmp);
        }