Exemplo n.º 1
0
		void SetMaterial(MenkoBattleData data)
		{
			var renderer = m_transform.GetComponent<MeshRenderer>();
			var mats = renderer.sharedMaterials;
			mats[1] = ResourceUtils.GetFaceMat(data.BaseData.ID);
			mats[0] = ResourceUtils.GetBackMat(data.BaseData.Status.Element);
			renderer.sharedMaterials = mats;
		}
Exemplo n.º 2
0
		void SetColor(MenkoBattleData data)
		{
			var colorRing = m_transform.GetComponentInChildren<SpriteRenderer>();
			colorRing.enabled = data.IsRepresent;
			if (data.IsPlayer)
				colorRing.color = BattleConst.Menko.PlayerColor;
			else
				colorRing.color = BattleConst.Menko.RivalColor;
		}
Exemplo n.º 3
0
        void SetMaterial(MenkoBattleData data)
        {
            var renderer = m_transform.GetComponent <MeshRenderer>();
            var mats     = renderer.sharedMaterials;

            mats[1] = ResourceUtils.GetFaceMat(data.BaseData.ID);
            mats[0] = ResourceUtils.GetBackMat(data.BaseData.Status.Element);
            renderer.sharedMaterials = mats;
        }
Exemplo n.º 4
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.º 5
0
		public BattleUnit(uint[] monsterIDList, bool[] isRepresents, bool isPlayer)
		{
			int length = monsterIDList.Length;
			menkoDataList = new MenkoBattleData[length];
			for (int i = 0; i < length; ++i)
			{
				menkoDataList[i] = new MenkoBattleData(monsterIDList[i], isPlayer, isRepresents[i]);
			}
		}
Exemplo n.º 6
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.º 7
0
 public void SetUp(MenkoBattleData data, SkillController skillController, Vector3 pos)
 {
     this.data            = data;
     this.skillController = skillController;
     components           = new MenkoComponents(this, data);
     gameObject.SetActive(data.IsRepresent);
     components.position = pos;
     components.RotY     = data.IsPlayer ? 180f : 0f;
     components.scale    = Vector3.one * BattleConst.Menko.SizeToScale(data.BaseData.Character.Size);
 }
Exemplo n.º 8
0
        public BattleUnit(uint[] monsterIDList, bool[] isRepresents, bool isPlayer)
        {
            int length = monsterIDList.Length;

            menkoDataList = new MenkoBattleData[length];
            for (int i = 0; i < length; ++i)
            {
                menkoDataList[i] = new MenkoBattleData(monsterIDList[i], isPlayer, isRepresents[i]);
            }
        }
Exemplo n.º 9
0
		public void SetUp(MenkoBattleData data, SkillController skillController, Vector3 pos)
		{
			this.data = data;
			this.skillController = skillController;
			components = new MenkoComponents(this, data);
			gameObject.SetActive(data.IsRepresent);
			components.position = pos;
			components.RotY = data.IsPlayer ? 180f : 0f;
			components.scale = Vector3.one * BattleConst.Menko.SizeToScale(data.BaseData.Character.Size);
		}
Exemplo n.º 10
0
 public int GetIndex(MenkoBattleData data)
 {
     for (int i = 0; i < menkoDataList.Length; ++i)
     {
         if (data == menkoDataList[i])
         {
             return(i);
         }
     }
     return(-1);
 }
Exemplo n.º 11
0
		public int GetIndex(MenkoBattleData data)
		{
			for (int i = 0; i < menkoDataList.Length; ++i)
			{
				if (data == menkoDataList[i])
				{
					return i;
				}
			}
			return -1;
		}
Exemplo n.º 12
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.º 13
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.º 14
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.º 15
0
        void SetColor(MenkoBattleData data)
        {
            var colorRing = m_transform.GetComponentInChildren <SpriteRenderer>();

            colorRing.enabled = data.IsRepresent;
            if (data.IsPlayer)
            {
                colorRing.color = BattleConst.Menko.PlayerColor;
            }
            else
            {
                colorRing.color = BattleConst.Menko.RivalColor;
            }
        }
Exemplo n.º 16
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.º 17
0
		List<UnitVM> CreateUnitVMList(MenkoBattleData[] unitList)
		{
			List<UnitVM> unitVMList = new List<UnitVM>();
			for (int i = 0; i < unitList.Length; ++i)
			{
				var unit = unitList[i];
				string path = AssetPath.GetMonsterFaceTexPath(unit.BaseData.ID);
				var assetData = AssetManager.Load<Sprite>(path);
				var face = assetData.Asset as Sprite;
				var vm = new UnitVM(face, unit.IsRepresent, unit.SkillData.NeedTurn);
                unitVMList.Add(vm);
				unit.UnitViewModel = vm;
			}
			return unitVMList;
		}
Exemplo n.º 18
0
		public static Menko CreateInstance(MenkoBattleData battleData, SkillController skillController, Vector3 pos)
		{
			var instance = Instantiate(AssetManager.Load(BattleConst.Menko.BaseMenkoPath).Asset) as GameObject;

			Menko result;
			if (battleData.IsRepresent)
			{
				result = instance.AddComponent<RepresentMenko>();
			}
			else
			{
				result = instance.AddComponent<AttackerMenko>();
			}

			result.SetUp(battleData, skillController, pos);
			return result;
		}
Exemplo n.º 19
0
        public static Menko CreateInstance(MenkoBattleData battleData, SkillController skillController, Vector3 pos)
        {
            var instance = Instantiate(AssetManager.Load(BattleConst.Menko.BaseMenkoPath).Asset) as GameObject;

            Menko result;

            if (battleData.IsRepresent)
            {
                result = instance.AddComponent <RepresentMenko>();
            }
            else
            {
                result = instance.AddComponent <AttackerMenko>();
            }

            result.SetUp(battleData, skillController, pos);
            return(result);
        }
Exemplo n.º 20
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.º 21
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);
            }
        }