Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public void SetRotation(string id, float angleRad)
 {
     this.Log($"{nameof(SetRotation)}", id, angleRad);
     engine.SetRotation(ObjectsCache.FindGameObject(id), angleRad);
 }
Exemplo n.º 5
0
 public void SetAnimation(string id, Animation animation)
 {
     this.Log($"{nameof(SetAnimation)}", id, animation);
     engine.SetAnimation(ObjectsCache.FindGameObject(id), animation);
 }
Exemplo n.º 6
0
 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));
 }
Exemplo n.º 7
0
 public void Freeze(string id)
 {
     this.Log($"{nameof(Freeze)}", id);
     engine.Freeze(ObjectsCache.FindGameObject(id));
 }
Exemplo n.º 8
0
 public void SetFlag(string id, string ownerId)
 {
     this.Log($"{nameof(SetFlag)}", id, ownerId);
     engine.SetFlag(ObjectsCache.FindGameObject(id), ownerId);
 }
Exemplo n.º 9
0
 public void SetPosition(string id, int x, int y)
 {
     this.Log($"{nameof(SetPosition)}", id, x, y);
     engine.SetPosition(ObjectsCache.FindGameObject(id), x, y);
 }
Exemplo n.º 10
0
 public void Move(string id, Direction direction, double duration)
 {
     this.Log($"{nameof(Move)}", id, direction, duration);
     engine.Move(ObjectsCache.FindGameObject(id), direction, (float)duration);
 }