private void OnTriggerEnter(Collider other) { if (other.tag == "Player") { if (sphereType.ToString() == "Score") { Controller.score++; Controller.velocity += 0.01f; } else if (sphereType.ToString() == "Help") { if (Controller.life < 5) { Controller.life++; } Controller.score++; Controller.velocity += 0.01f; } else if (sphereType.ToString() == "Evil") { if (Controller.life > 0) { Controller.life--; } } other.GetComponent <Controller>().CatchObject(this.gameObject); } }
private void GenerateSphereMeshThread(object obj) { if (SphereType == SphereType.uvsphere) { _sphereMesh = UvSphereBuilder.Generate(Radius, Resolution); } else { IPlatonicSolid baseSolid = GetBaseSolid(SphereType); _sphereMesh = SphereBuilder.Build(baseSolid, Radius, Resolution, Smooth, RemapVertices); } Debug.Log(SphereType.ToString() + " generated: " + _sphereMesh.Triangles.Length + " tris and " + _sphereMesh.Vertices.Length + " verts."); }
public static Composite CreateMoveToSphereBehavior(SphereType typ) { return new Sequence( new Action(ret => { WoWObject sph = FindSphere(typ); if (sph != null && sph.Guid != lastSphere) { lastSphere = sph.Guid; Logger.WriteDebug("CreateMonkRest: Moving {0:F1} yds to {1} Sphere {2}", sph.Distance, typ.ToString(), lastSphere ); } }), Movement.CreateMoveToLocationBehavior(ret => FindSphereLocation(SphereType.Life), true, ret => 0f), new ActionAlwaysSucceed() ); }