Exemplo n.º 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);
            }
Exemplo n.º 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);
		}
Exemplo n.º 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);
 }
Exemplo n.º 4
0
 public void Remove(Menko menko)
 {
     if (menko.IsPlayer())
     {
         players.Remove(menko);
     }
     else
     {
         rivals.Remove(menko);
     }
 }
Exemplo n.º 5
0
 public void Add(Menko menko)
 {
     if (menko.IsPlayer())
     {
         players.Add(menko);
     }
     else
     {
         rivals.Add(menko);
     }
 }
Exemplo n.º 6
0
		public void Add(Menko menko)
		{
			if (menko.IsPlayer())
			{
				players.Add(menko);
			}
			else
			{
				rivals.Add(menko);
			}
		}
Exemplo n.º 7
0
		public void Remove(Menko menko)
		{
			if (menko.IsPlayer())
			{
				players.Remove(menko);
			}
			else
			{
				rivals.Remove(menko);
			}
		}
Exemplo n.º 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);
 }
Exemplo n.º 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");
		}
Exemplo n.º 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;
		}
Exemplo n.º 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;
 }
Exemplo n.º 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");
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
         }
     }
 }
Exemplo n.º 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);
			}
		}
Exemplo n.º 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);
            }
        }
Exemplo n.º 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;
		}
Exemplo n.º 18
0
			bool IsSleep(Menko menko)
			{
				return menko.IsSleep();
			}
Exemplo n.º 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);
			}
Exemplo n.º 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);
					}
				}
			}
Exemplo n.º 21
0
 bool IsSleep(Menko menko)
 {
     return(menko.IsSleep());
 }