/// <summary> /// 点击场景角色或物件 /// </summary> void MouseDownInTheScene() { //释放怒气 if (Input.GetMouseButtonDown(0)) { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit; if (Physics.Raycast(ray, out hit, 100, 1 << LayerMask.NameToLayer("Role"))) { Role w = hit.transform.GetComponentInParent <LifeProperty>().GetLife() as Role; if (w != null && w.m_Core.m_IsPlayer == true) { if (w.Anger >= ConfigM.GetAngerK(1)) { w.ReleaseSkillEffect(); } } } ray = EffectCamera.camera.ScreenPointToRay(Input.mousePosition); //拾取资源 if (Physics.Raycast(ray, out hit, 100, 1 << LayerMask.NameToLayer("Resource"))) { GameObjectActionExcute gae = hit.transform.GetComponentInParent <GameObjectActionExcute>(); if (gae != null) { GameObjectAction ga = gae.GetCurrentAction(); if (ga is GameObjectActionWait || ga is GameObjectActionBoxWait) { gae.GoNextAction(); } } } } }
/** * Recursively traverse the hierarchy of a GameObject and invoke the given function. * * @param obj GameObject * @param func function to be invoked */ public static void TraverseHierarchy(GameObject obj, GameObjectAction func) { foreach (Transform t in obj.transform) { func(t.gameObject); TraverseHierarchy(t.gameObject, func); } }
public void AddAction(GameObjectAction action) { if (action != null) { m_list.Add(action); if (m_target != null) { action.SetTarget(m_target); } } }
public void AddAction(GameObjectAction action) { if (action != null) { m_list.Add(action); m_Duration += action.GetLeftTime(); /*if (m_target != null) * { * action.SetTarget(m_target); * }*/ } }
public void AddAction(GameObjectAction action) { if (action != null) { m_list.Add(action); if (GetLeftTime() < action.GetLeftTime()) { m_Duration += action.GetLeftTime() - GetLeftTime(); } if (m_target != null) { action.SetTarget(m_target); } } }
/// <summary> /// 添加状态特效 /// </summary> /// <param name="isEnable"></param> public void AddStatusEffect(StatusInfo Info, WalkDir dir) { if (Info == null) { return; } if (m_StatusEffect.ContainsKey(Info.effectid) && m_StatusEffect[Info.effectid] != null) { GameObjectActionExcute gae = m_StatusEffect[Info.effectid].go.GetComponent <GameObjectActionExcute>(); GameObjectAction ga = gae.GetCurrentAction(); if (ga != null && ga is GameObjectActionDelayDestory) { (ga as GameObjectActionDelayDestory).ResetDuration(Info.time); } /*td.AddTime(); * if (td != null) * td.ResetDuration(Info.time);*/ /*if (Info.effectid == 1101041) * { * td = m_StatusEffect[1101031].GetComponent<NdDestroy>(); * td.AddTime(); * if (td != null) * td.ResetDuration(Info.time); * }*/ } else { GameObject go = AddStatusEffect(Info.position, Info.time, Info.effectid, dir); if (go != null) { StatusEffectInfo info = new StatusEffectInfo(); info.go = go; info.SpePriority = Info.SpePriority; m_StatusEffect[Info.effectid] = info; SortEffect(Info.effectid, true); } /*if (Info.effectid == 1101041) * { * go = ProPerty.AddStatusEffect(3,Info.time,1101031,dir); * if(go != null) m_StatusEffect[1101031] = go; * }*/ } }
public void AddAction(GameObjectAction action) { m_actionlist.Add(action); }