Example #1
0
 public void UpdateObject()
 {
     UnityObject.name = "Projectile " + GraphicDesc.ModelIndex + " " + SceneX + " " + SceneY + " " + SceneZ;
     ApplyAnimations();
     UnityObject.transform.position = new Vector3(GameConstants.RScale((int)SceneX), GameConstants.RScale((int)SceneZ), GameConstants.RScale((int)SceneY));
     UnityObject.transform.rotation = Quaternion.Euler(0, Rotation / 5.688888888888889f, 0);
 }
Example #2
0
        public void Create()
        {
            if (TopModel != null)
            {
                TopObject        = new GameObject();
                TopModel.Backing = TopObject;
                TopModel.AddMeshToObject();
                TopObject.transform.position = new Vector3(GameConstants.RScale(SceneX), GameConstants.RScale(SceneY), GameConstants.RScale(SceneZ));

                var comp = TopObject.AddComponent <GroundItemComponent>();
                comp.Items = this;
                comp.Item  = TopItem;
                AddCollider(TopObject);
            }

            if (MiddleModel != null)
            {
                MiddleObject        = new GameObject();
                MiddleModel.Backing = MiddleObject;
                MiddleModel.AddMeshToObject();
                MiddleObject.transform.position = new Vector3(GameConstants.RScale(SceneX), GameConstants.RScale(SceneY), GameConstants.RScale(SceneZ));

                var comp = MiddleObject.AddComponent <GroundItemComponent>();
                comp.Items = this;
                comp.Item  = MiddleItem;
                AddCollider(MiddleObject);
            }

            if (BottomModel != null)
            {
                BottomObject        = new GameObject();
                BottomModel.Backing = BottomObject;
                BottomModel.AddMeshToObject();
                BottomObject.transform.position = new Vector3(GameConstants.RScale(SceneX), GameConstants.RScale(SceneY), GameConstants.RScale(SceneZ));

                var comp = BottomObject.AddComponent <GroundItemComponent>();
                comp.Items = this;
                comp.Item  = BottomItem;
                AddCollider(BottomObject);
            }
        }