Esempio 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;
        }
Esempio 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;
        }
Esempio 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);
        }
Esempio n. 4
0
 public void SetRotation(string id, float angleRad)
 {
     this.Log($"{nameof(SetRotation)}", id, angleRad);
     engine.SetRotation(ObjectsCache.FindGameObject(id), angleRad);
 }
Esempio n. 5
0
 public void SetAnimation(string id, Animation animation)
 {
     this.Log($"{nameof(SetAnimation)}", id, animation);
     engine.SetAnimation(ObjectsCache.FindGameObject(id), animation);
 }
Esempio 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));
 }
Esempio n. 7
0
 public void Freeze(string id)
 {
     this.Log($"{nameof(Freeze)}", id);
     engine.Freeze(ObjectsCache.FindGameObject(id));
 }
Esempio n. 8
0
 public void SetFlag(string id, string ownerId)
 {
     this.Log($"{nameof(SetFlag)}", id, ownerId);
     engine.SetFlag(ObjectsCache.FindGameObject(id), ownerId);
 }
Esempio 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);
 }
Esempio 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);
 }