public void RandomFaceActorPlay(string paramName) { PA_Param param = FindParam(paramName); if (param == null) { return; } float min = param.GetFloat(0); float max = param.GetFloat(1); if (min < max) { for (int i = 0; i < param.ObjectList.Count; ++i) { float v = Random.Range(min, max); Transform tr = param.ObjectList[i].GetComponent <Transform>(); if (tr != null) { tr.Rotate(Vector3.up, v); } } } ActorPlay(paramName); }
public void FadeOutToGivenCamera(string paramName) { PA_Param param = FindParam(paramName); if (param == null) { return; } Camera cam = GetCameraFromParam(param, 0); if (cam != null) { FadeEffect fadeEffect = GetARequiredComponent <FadeEffect>(cam.gameObject); if (fadeEffect == null) { return; } Color curColor = fadeEffect.blendColor; Color destColor = Color.black; float duration = param.GetFloat(0); TweenColorInternal(fadeEffect, curColor, destColor, duration); } }
public void ActorPlayWithRoot(string paramName) { PA_Param param = FindParam(paramName); if (param == null) { return; } string actionName = param.GetString(0); if (actionName != "") { GameObject root = param.GetGameObject(0); if (root == null) { return; } Animation[] animList = root.GetComponentsInChildren <Animation>(); for (int i = 0; i < animList.Length; ++i) { if (animList[i] != null) { animList[i].Play(actionName); } } } }
public void RandomFaceActorPlayWithRoot(string paramName) { PA_Param param = FindParam(paramName); if (param == null) { return; } float min = param.GetFloat(0); float max = param.GetFloat(1); if (min < max) { GameObject root = param.GetGameObject(0); if (root == null) { return; } Transform[] list = root.GetComponentsInChildren <Transform>(); for (int i = 0; i < list.Length; ++i) { float v = Random.Range(min, max); if (list[i] != null) { list[i].Rotate(Vector3.up, v); } } } }
public void PlayAnimation(string paramName) { PA_Param param = FindParam(paramName); if (param == null) { return; } GameObject obj = param.GetGameObject(0); PlayAnimationInPrefab(obj); }
public void CameraShake(string paramName) { PA_Param param = FindParam(paramName); if (param == null) { return; } GameObject center = param.GetGameObject(0); //float radius = param.GetFloat(0); bool shouldStart = false; if (center != null) { //if( CoreEntry.gTeamMgr.MainPlayer != null ) //{ // if( radius <= 0 ) // { // shouldStart = true; // } // else if ((CoreEntry.gTeamMgr.MainPlayer.transform.position - center.transform.position).magnitude <= radius) // { // shouldStart = true; // } //} } else { shouldStart = true; } if (shouldStart) { Camera cam = GetCameraFromParam(param, 1); if (cam != null) { float scale = param.GetFloat(1); if (scale <= 0f) { scale = 1f; } CameraEffect effect = GetARequiredComponent <CameraEffect>(cam.gameObject); if (effect != null) { effect.Scale = scale; effect.ShakeStart(); } } } }
public void ResetRotation(string paramName) { PA_Param param = FindParam(paramName); if (param == null) { return; } GameObject obj = param.GetGameObject(0); if (obj != null) { obj.transform.localRotation = Quaternion.identity; } }
//Color destColor; // Color curColor; //FadeEffect fadeFffect = null; // float fadeDuration = 1.0f; public Camera GetCameraFromParam(PA_Param param, int index) { Camera cam = null; GameObject obj = param.GetGameObject(index); if (obj != null) { cam = obj.GetComponent <Camera>(); } if (cam == null) { cam = Camera.main; } return(cam); }
public void TurnToBoss(string paramName) { PA_Param param = FindParam(paramName); if (param == null) { return; } GameObject obj = param.GetGameObject(0); if (obj != null) { GameObject tmpBoss = GetBoss(); Transform chestSocket = tmpBoss.GetComponent <ActorObj>().GetChildTransform("E_Spine"); float time = param.GetFloat(0); StartCoroutine(TuningToObject(obj, chestSocket, time)); } }
public void RandomDelayReplay(string paramName) { PA_Param param = FindParam(paramName); if (param == null) { return; } float min = param.GetFloat(0); float max = param.GetFloat(1); if (max <= min) { Replay(); } else { float v = Random.Range(min, max); Invoke("Replay", v); } }
public void ActorPlay(string paramName) { PA_Param param = FindParam(paramName); if (param == null) { return; } string actionName = param.GetString(0); if (actionName != "") { for (int i = 0; i < param.ObjectList.Count; ++i) { Animation anim = param.ObjectList[i].GetComponent <Animation>(); if (anim != null) { anim.Play(actionName); } } } }