public static bool CanKillBody(OccpType type1, OccpType type2) { if (type1 == OccpType.Occp_TIGER) { if (type2 == OccpType.Occp_CHICK) { return(true); } } else if (type1 == OccpType.Occp_STICK) { if (type2 == OccpType.Occp_TIGER) { return(true); } } else if (type1 == OccpType.Occp_CHICK) { if (type2 == OccpType.Occp_STICK) { return(true); } } return(false); }
//进入换职业状态 public void SwitchOtherOccp() { OccpType occp = Util.GetNextOccp(occupation); int id = Util.GetHeroIdByOccp(occp); EquipInfo info = InfoMgr <EquipInfo> .Instance.GetInfo(id); if (null == info) { Debuger.LogError("裝備表錯誤ID:" + id); return; } ChangeOccp(occp, info.modelId); UpdateModelScale(); }
void InitEntity(OccpType occp, int heroId) { Vector3 location = GameMgr.Instance.RandomLocation(); CacheModel.localRotation = Quaternion.Euler(0, Random.Range(0, 360), 0); CacheModel.position = location; ChangeOccp(occp, heroId); UpdateCharacControllerActive(true); HeroInfo heroInfo = InfoMgr <HeroInfo> .Instance.GetInfo(heroId); InitAttribute(heroInfo); InitSkill(); Protect(); init = true; }
public void SwitchOccp() { if (IsAlive) { OccpType occp = Util.GetNextOccp(Occupation); int id = Util.GetNetEquipIdByOccp(occp); EquipInfo info = InfoMgr <EquipInfo> .Instance.GetInfo(id); if (null == info) { return; } ChangeOccp(occp, info.modelId); UpdateModelScale(); EndCurrentStateToOtherState(StateID.Idle); } }
//GameObject SpawnerGO(int heroId, Vector3 v) //{ // HeroInfo heroInfo = InfoMgr<HeroInfo>.Instance.GetInfo(heroId); // GameObject go = ResourcesMgr.Instance.Spawner(heroInfo.model, v, ResourceType.RESOURCE_ENTITY, transform);// ResourcesMgr.Instance.Instantiate(prefab); // return go; //} void ChangeOccp(OccpType occp, int heroId) { HeroId = heroId; HeroInfo heroInfo = InfoMgr <HeroInfo> .Instance.GetInfo(heroId); GameObject go = ResourcesMgr.Instance.Spawner(heroInfo.model, ResourceType.RESOURCE_ENTITY, CacheModel);// ResourcesMgr.Instance.Instantiate(prefab); if (null == go) { Debug.LogError(heroInfo.model + " is null"); return; } ResourcesMgr.Instance.Despawner(ResourceType.RESOURCE_ENTITY, RoleModel); RoleModel = null; Occupation = occp; InitCharactor(go); }
public static int GetNetEquipIdByOccp(OccpType occp) { int id = -1; switch (occp) { case OccpType.Occp_TIGER: id = TSCData.Instance.Role.KeyTigerID; break; case OccpType.Occp_STICK: id = TSCData.Instance.Role.KeyStickID; break; case OccpType.Occp_CHICK: id = TSCData.Instance.Role.KeyChickID; break; } return(id); }
public static OccpType GetNextOccp(OccpType curType) { OccpType oc = OccpType.NONE; switch (curType) { case OccpType.Occp_TIGER: oc = OccpType.Occp_STICK; break; case OccpType.Occp_STICK: oc = OccpType.Occp_CHICK; break; case OccpType.Occp_CHICK: oc = OccpType.Occp_TIGER; break; } return(oc); }
public void CreateNetEntity(int idx) { Id = (idx + 1); int occp = idx % 3; OccpType oc = (OccpType)(occp + 1); int equipID = Util.GetNetEquipIdByOccp(oc); EquipInfo info = InfoMgr <EquipInfo> .Instance.GetInfo(equipID); if (null == info) { Debuger.LogError("裝備ID錯誤:" + equipID); return; } InitEntity(oc, info.modelId); RandomName(); EndDeadState(); ResetAttribute(); CreateHUDName(); CreateEntityInfo(); }
public static bool IsSameOccp(OccpType occ1, OccpType occ2) { return(occ1 == occ2); }
//public string RoleName //{ // get // { // return roleName; // } // set // { // roleName = value; // } //} //public bool IsWalking //{ // get // { // return isWalking; // } // set // { // isWalking = value; // } //} public void InitEntity(OccpType occp, int heroId) { ChangeOccp(occp, heroId); UpdateCharacControllerActive(true); init = true; }