public virtual void SetUpScene(int width, int height) { var camera = ObjectsCache.FindGameObject("Camera"); camera.transform.position = new Vector3(width / 2 + 12, 10, width / 2 - 1); camera.transform.rotation = Quaternion.Euler(45, -90, 0); camera.GetComponent <Camera>().fieldOfView = 45; var light = ObjectsCache.FindGameObject("Main Light").GetComponent <Light>(); light.intensity = 1.3f; light.shadowStrength = 0.8f; }
public void SetFlag(GameObject obj, string ownerId) { var flagId = obj.name + " flag"; var oldFlag = ObjectsCache.FindGameObject(flagId); if (oldFlag != null) { GameObject.Destroy(oldFlag); } var flag = CreateObject(flagId, MapObject.Flag); SetColor(flag, heroColors.GetOrDefault(ownerId, Color.white)); flag.transform.position = obj.transform.position + Vector3.up * 0.3f; flag.transform.parent = obj.transform; }
public void TurnIntoCorpse(string actorId, string corpseId) { this.Log("TurnIntoCorpse", actorId, corpseId); var actorBody = ObjectsCache.FindGameObject(actorId); GameObject.Destroy(actorBody.GetComponent <Collider>()); actorBody.GetComponent <Animator>().Play("Death"); actorBody.name = corpseId; foreach (Transform child in actorBody.transform) { if (child.gameObject.name == "Marker") { GameObject.Destroy(child.gameObject); } } _commonEngine.SetAbsoluteSpeed(corpseId, Frame3D.Identity); }
public void SetRotation(string id, float angleRad) { this.Log($"{nameof(SetRotation)}", id, angleRad); engine.SetRotation(ObjectsCache.FindGameObject(id), angleRad); }
public void SetAnimation(string id, Animation animation) { this.Log($"{nameof(SetAnimation)}", id, animation); engine.SetAnimation(ObjectsCache.FindGameObject(id), animation); }
public void SetColor(string id, float r, float g, float b) { this.Log($"{nameof(SetColor)}", id, r, g, b); engine.SetColor(ObjectsCache.FindGameObject(id), new Color(r, g, b)); }
public void Freeze(string id) { this.Log($"{nameof(Freeze)}", id); engine.Freeze(ObjectsCache.FindGameObject(id)); }
public void SetFlag(string id, string ownerId) { this.Log($"{nameof(SetFlag)}", id, ownerId); engine.SetFlag(ObjectsCache.FindGameObject(id), ownerId); }
public void SetPosition(string id, int x, int y) { this.Log($"{nameof(SetPosition)}", id, x, y); engine.SetPosition(ObjectsCache.FindGameObject(id), x, y); }
public void Move(string id, Direction direction, double duration) { this.Log($"{nameof(Move)}", id, direction, duration); engine.Move(ObjectsCache.FindGameObject(id), direction, (float)duration); }