Пример #1
0
            public void Remove(Menko menko)
            {
                menko.gameObject.SetActive(false);
                var effect = Object.Instantiate(ResourceUtils.GetMenkoReturnEffect());

                effect.transform.position = menko.transform.position + Vector3.up * 0.2f;
                Object.Destroy(effect.gameObject, effect.Duration);
            }
Пример #2
0
		public MenkoComponents(Menko menko, MenkoBattleData data)
		{
			m_transform = menko.GetComponent<Transform>();
			m_rigidbody = menko.GetComponent<Rigidbody>();
			velocity = m_rigidbody.velocity;
			torque = m_rigidbody.angularVelocity;
			SetMaterial(data);
			SetColor(data);
		}
Пример #3
0
 public MenkoComponents(Menko menko, MenkoBattleData data)
 {
     m_transform = menko.GetComponent <Transform>();
     m_rigidbody = menko.GetComponent <Rigidbody>();
     velocity    = m_rigidbody.velocity;
     torque      = m_rigidbody.angularVelocity;
     SetMaterial(data);
     SetColor(data);
 }
Пример #4
0
 public void Remove(Menko menko)
 {
     if (menko.IsPlayer())
     {
         players.Remove(menko);
     }
     else
     {
         rivals.Remove(menko);
     }
 }
Пример #5
0
 public void Add(Menko menko)
 {
     if (menko.IsPlayer())
     {
         players.Add(menko);
     }
     else
     {
         rivals.Add(menko);
     }
 }
Пример #6
0
		public void Add(Menko menko)
		{
			if (menko.IsPlayer())
			{
				players.Add(menko);
			}
			else
			{
				rivals.Add(menko);
			}
		}
Пример #7
0
		public void Remove(Menko menko)
		{
			if (menko.IsPlayer())
			{
				players.Remove(menko);
			}
			else
			{
				rivals.Remove(menko);
			}
		}
Пример #8
0
 public int GetPlayerIndex(Menko menko)
 {
     Menko[] playersAll = players.All;
     for (int i = 0; i < playersAll.Length; i++)
     {
         if (playersAll[i] == menko)
         {
             return(i);
         }
     }
     return(-1);
 }
Пример #9
0
		/// <summary>
		/// スキルの実行
		/// </summary>
		/// <param name="skillData"></param>
		public void Run(MenkoList menkoList, MenkoBattleData battleData, Menko invoker, Action callback)
		{
			Debug.Log("Run Start");
			if (battleData == null)
				return;

			this.menkoList = menkoList;
			this.battleData = battleData;
			this.invoker = invoker;
			this.callback = callback;
			Execute();
			Debug.Log("Executed - skillbase");
		}
Пример #10
0
		public SkillPlayTask(
			BattleManager manager,
			Menko invoker,
			MenkoBattleData battleData,
			SkillBase skill,
			Action nextCall)
		{
			this.manager = manager;
			this.invoker = invoker;
			this.battleData = battleData;
			this.skill = skill;
			this.nextCall = nextCall;
		}
Пример #11
0
 public SkillPlayTask(
     BattleManager manager,
     Menko invoker,
     MenkoBattleData battleData,
     SkillBase skill,
     Action nextCall)
 {
     this.manager    = manager;
     this.invoker    = invoker;
     this.battleData = battleData;
     this.skill      = skill;
     this.nextCall   = nextCall;
 }
Пример #12
0
        /// <summary>
        /// スキルの実行
        /// </summary>
        /// <param name="skillData"></param>
        public void Run(MenkoList menkoList, MenkoBattleData battleData, Menko invoker, Action callback)
        {
            Debug.Log("Run Start");
            if (battleData == null)
            {
                return;
            }

            this.menkoList  = menkoList;
            this.battleData = battleData;
            this.invoker    = invoker;
            this.callback   = callback;
            Execute();
            Debug.Log("Executed - skillbase");
        }
Пример #13
0
        protected override void CollisionEnter(Collision enter)
        {
            // HitSEの再生
            Sound.Instance.PlaySE(hitClip);

            if (!isAttack)
            {
                return;
            }

            // スキル発動
            if (isUseSkill)
            {
                Debug.Log("UsingSkill");
                isUseSkill = false;
                skillController.InvokeSkill(data, this);
            }

            if (enter.gameObject.tag != "Monster")
            {
                return;
            }

            Menko opponent = enter.gameObject.GetComponent <Menko>();

            if (opponent.IsPlayer())
            {
                return;
            }

            isAttack = false;

            // ダメージを相手に与える
            opponent.Damage(this.data.Status, 1.0f);             // TODO: 位置倍率計算を入れる

            // 攻撃エフェクトの発生(弱点の考慮)
            var effect = Instantiate(ResourceUtils.GetMenkoHitEffect(data.Status.Element));

            effect.transform.position = enter.contacts[0].point + Vector3.up * 0.25f;
            Destroy(effect.gameObject, effect.Duration);

            // 攻撃SEの再生
            Sound.Instance.PlaySE(attackClip);
        }
Пример #14
0
 public void Add(Menko menko)
 {
     if (menko.IsRepresent())
     {
         if (!represents.Contains(menko))
         {
             all.Add(menko);
             represents.Add(menko);
         }
         return;
     }
     else
     {
         if (!attackers.Contains(menko))
         {
             all.Add(menko);
             attackers.Add(menko);
         }
     }
 }
Пример #15
0
		/// <summary>
		/// スキルの実行
		/// </summary>
		/// <param name="battleData"></param>
		public void InvokeSkill(MenkoBattleData battleData, Menko invoker)
		{
			Debug.Log("Invoke Skill");
			string skillPath = AssetPath.GetSkillPrefabPath(battleData.SkillData.UseSkillID);
			var skillPrefab = AssetManager.Load<SkillBase>(skillPath).Asset as SkillBase;
			SkillBase skill = GameObject.Instantiate(skillPrefab);
			skill.gameObject.SetActive(false);
			skill.transform.position = invoker.transform.position;
			skill.transform.SetPosY(0f);

			var playTask = new SkillPlayTask(manager, invoker, battleData, skill, NextCall);

			if (currentPlay == null)
			{
				manager.MenkoList.StopRigidAll();
				currentPlay = playTask;
				currentPlay.Invoke();
			}
			else
			{
				task.Enqueue(playTask);
			}
		}
Пример #16
0
        /// <summary>
        /// スキルの実行
        /// </summary>
        /// <param name="battleData"></param>
        public void InvokeSkill(MenkoBattleData battleData, Menko invoker)
        {
            Debug.Log("Invoke Skill");
            string    skillPath   = AssetPath.GetSkillPrefabPath(battleData.SkillData.UseSkillID);
            var       skillPrefab = AssetManager.Load <SkillBase>(skillPath).Asset as SkillBase;
            SkillBase skill       = GameObject.Instantiate(skillPrefab);

            skill.gameObject.SetActive(false);
            skill.transform.position = invoker.transform.position;
            skill.transform.SetPosY(0f);

            var playTask = new SkillPlayTask(manager, invoker, battleData, skill, NextCall);

            if (currentPlay == null)
            {
                manager.MenkoList.StopRigidAll();
                currentPlay = playTask;
                currentPlay.Invoke();
            }
            else
            {
                task.Enqueue(playTask);
            }
        }
Пример #17
0
		public int GetPlayerIndex(Menko menko)
		{
			Menko[] playersAll = players.All;
			for (int i = 0; i < playersAll.Length; i++)
			{
				if (playersAll[i] == menko)
				{
					return i;
				}
			}
			return -1;
		}
Пример #18
0
			bool IsSleep(Menko menko)
			{
				return menko.IsSleep();
			}
Пример #19
0
			public void Remove(Menko menko)
			{
				menko.gameObject.SetActive(false);
				var effect = Object.Instantiate(ResourceUtils.GetMenkoReturnEffect());
				effect.transform.position = menko.transform.position + Vector3.up * 0.2f;
				Object.Destroy(effect.gameObject, effect.Duration);
			}
Пример #20
0
			public void Add(Menko menko)
			{
				if (menko.IsRepresent())
				{
					if (!represents.Contains(menko))
					{
						all.Add(menko);
						represents.Add(menko);
					}
					return;
				}
				else
				{
					if (!attackers.Contains(menko))
					{
						all.Add(menko);
						attackers.Add(menko);
					}
				}
			}
Пример #21
0
 bool IsSleep(Menko menko)
 {
     return(menko.IsSleep());
 }