public void RemoveSkillHitHighLightEffect(GameObject go) { SkinnedMeshRenderer[] renderers = go.GetComponentsInChildren <SkinnedMeshRenderer>(); for (int i = 0; i < renderers.Length; i++) { SkinnedMeshRenderer renderer = renderers[i]; if (renderer != null && renderer.sharedMaterial != null) { if (oldIntensityMap.ContainsKey(renderer.GetInstanceID())) { renderer.material.shader = Shader.Find(oldIntensityMap[renderer.GetInstanceID()]); oldIntensityMap.Remove(renderer.GetInstanceID()); } } } }
public void SkillHitHighLightEffect(GameObject go) { SkinnedMeshRenderer[] renderers = go.GetComponentsInChildren <SkinnedMeshRenderer>(); for (int i = 0; i < renderers.Length; i++) { SkinnedMeshRenderer renderer = renderers[i]; if (renderer != null && renderer.sharedMaterial != null) { if (!oldIntensityMap.ContainsKey(renderer.GetInstanceID())) { oldIntensityMap.Add(renderer.GetInstanceID(), renderer.material.shader.name); } renderer.material.shader = Shader.Find("SnailHitShine"); } } }
public void UnsubscribeToBindPoseChanges(SkinnedMeshRenderer smr) { if (subscribers == null || smr == null) { return; } for (int i = subscribers.Count - 1; i >= 0; i--) { if (subscribers[i].GetInstanceID().Equals(smr.GetInstanceID())) { subscribers.RemoveAt(i); } } }
public void CloneMeshProperly(SkinnedMeshRenderer smr) { if (smr == null || smr.sharedMesh == null) { return; } int id = smr.GetInstanceID(); if (m_cloned_lookup.ContainsKey(id)) { return; } Mesh mesh = smr.sharedMesh; mesh = (Mesh)Instantiate(mesh); mesh.name = mesh.name.Replace("(Clone)", "-Copy"); smr.sharedMesh = mesh; m_cloned_lookup[id] = true; }
protected int GetKeyFromSMR(SkinnedMeshRenderer smr) { return(smr.GetInstanceID()); }