public void StartFly(Vector3 inOringPos, float inSphereR, float inFlyseed) { flyspeed = inFlyseed * Random.Range(0.8f, 1.1f); animator.speed = Random.Range(0.8f, 1.1f); orginPos = inOringPos; transform.position = inOringPos; sphereR = inSphereR; flyPath.Add(orginPos); Vector3 newPos = Random.onUnitSphere * sphereR; newPos = new Vector3(newPos.x, 0.1f * newPos.y, newPos.z) + orginPos; flyPath.Add(newPos); float flyTime = (flyPath[1] - flyPath[0]).magnitude; flyTime = flyTime / flyspeed; transform.DOPath(flyPath.ToArray(), flyTime, PathType.Linear, PathMode.Full3D, 5, new Color(1, 0, 0)).OnComplete(FlyNextPosition).SetEase(Ease.InOutSine); transform.DOLookAt(flyPath[1], 1f); //#if UNITY_EDITOR SceneInteractiveManger.RecoverMatShaderSkinMesh(transform); //#endif }
public void CreatePoint360HXScrollMenu(SceneInteractiveManger s) { string[] point360HXNameG = s.assetBundleManager.point360SceneNameGroup.ToArray(); string[] displayNameG = new string[point360HXNameG.Length]; for (int i = 0; i < point360HXNameG.Length; i++) { displayNameG[i] = point360HXNameG[i].Replace("_360", ""); } huXingScrollMenu.CreateItemGroup(displayNameG, point360HXNameG); }
void Start() { foreach (GameObject g in carPerfabGroup) { SceneInteractiveManger.RecoverMatShader(g.transform); } if (autoSpawn) { GenAllLanePath(); SpawnCars(); } }
public void Initl(CarManger inCarManger, Vector3[] inMovePaht, int startID, float speedFactor) { #if UNITY_EDITOR SceneInteractiveManger.RecoverMatShader(transform); #endif speed *= speedFactor; carManger = inCarManger; movePath = inMovePaht; currentAtMovePathID = startID; transform.position = movePath[currentAtMovePathID]; Run(); }
public void StartMove(Transform searchRoot) { //#if UNITY_EDITOR SceneInteractiveManger.RecoverMatShaderSkinMesh(transform); //#endif SearchPointGroup = searchRoot; likeGroup = new bool[12] { likeClaphands, likeDance, likeEatsitting, likeIdle, likeListen, likeManipulate, likeSitidle, likeTalk, likeWalk, likeWalkCarry, likeFtStart, likeFtEnd }; ID = (int)(materialsGroup.Length * Random.value); skinnedMeshBase = transform.Find(skinnedMeshBasePath); skinnedMeshBase.GetComponent <SkinnedMeshRenderer>().sharedMaterial = materialsGroup[ID]; aniSpeed = aniSpeed * (0.5f * Random.value + 0.75f); GetComponent <UnityEngine.AI.NavMeshAgent>().speed = aniSpeed; foreach (AnimationState state in GetComponent <Animation>()) { state.speed = aniSpeed; } GetComponent <Animation>().Play(defaultAnimaiton); // animation["walk"].weight = 0.01F; // animation["dance"].weight = 1F; // animation["dance"].blendMode = AnimationBlendMode.Additive; // animation.Play("claphands"); // animation.Play("dance"); // animation.Play("eatsitting"); // animation.Play("idle"); // animation.Play("listen"); // animation.Play("manipulate"); // animation.Play("sitidle"); // animation.Play("talk"); // animation["claphands"].wrapMode = WrapMode.Once; // animation.Play("walk"); // animation["talk"].layer =1 ; // animation["dance"].blendMode = AnimationBlendMode.Blend; // animation["dance"].AddMixingTransform(shoulder); // animation["dance"].weight = 0.01F; // animation.Play("dance"); // animation.Play("walk"); // animation.Blend("dance",0.5f,0.3f); // animation.Play("manipulate"); // animation.CrossFadeQueued("walk", 1F, QueueMode.CompleteOthers); StartCoroutine(AutoMove()); }
void Start() { if (sceneInteractiveManger == null) { GameObject g = GameObject.Find("GlobalManager"); if (g != null) { sceneInteractiveManger = g.GetComponent <SceneInteractiveManger>(); } if (sceneInteractiveManger != null) { sceneInteractiveManger.AddSenceInteractiveInfo(this); } } }
public void CreateHuXingScrollMenu(SceneInteractiveManger s) { hxfbScene = s.mainSenceInteractiveInfo; //先移除SetImageZoomInAndZoomOutBtnFalse这个方法,再添加.保证只添加了一次 hxfbScene.touchCtrl.hxfbColliderTriggerEvent.RemoveListener(DoubleClickHXFBBox); hxfbScene.touchCtrl.hxfbColliderTriggerEvent.AddListener(DoubleClickHXFBBox); string[] hxNameG = new string[hxSceneHuXingTypeFinal.Length]; string[] displayNameG = new string[hxSceneHuXingTypeFinal.Length]; for (int i = 0; i < hxSceneHuXingTypeFinal.Length; i++) { if (hxSceneHuXingTypeFinal[i].displayName == "") { hxSceneHuXingTypeFinal[i].displayName = hxSceneHuXingTypeFinal[i].hxName; } hxNameG[i] = hxSceneHuXingTypeFinal[i].hxName; displayNameG[i] = hxSceneHuXingTypeFinal[i].displayName; } huXingScrollMenu.CreateItemGroup(displayNameG, hxNameG); }