Example #1
0
File: Battle.cs Project: wjk17/WSA
 public override void _Awake()
 {
     base._Awake();
     prevTrans = CharCtrl.I.collider.Tran2();
     rw = new RandomWrap();
     CalculatePos();
 }
Example #2
0
        public static Tran2 Lerp(Component c2, Component c, float time)
        {
            var nt = new Tran2();

            nt.pos = Vector3.Lerp(c2.transform.position, c.transform.position, time);
            nt.rot = Quaternion.Lerp(c2.transform.rotation, c.transform.rotation, time);
            return(nt);
        }
Example #3
0
        public static Tran2 Lerp(Transform t1, Transform t2, float time)
        {
            var nt = new Tran2();

            nt.pos = Vector3.Lerp(t1.position, t2.position, time);
            nt.rot = Quaternion.Lerp(t1.rotation, t2.rotation, time);
            return(nt);
        }
Example #4
0
        public static Tran2 Absolute(Transform parent, Tran2 local)
        {
            Tran2 t2 = new Tran2();

            t2.pos = parent.TransformPoint(local.pos);
            t2.rot = parent.rotation * local.rot;
            return(t2);
        }
Example #5
0
 public static void SetTran2(this Transform target, Tran2 trans, bool local)
 {
     if (local)
     {
         SetTran2Local(target, trans);
     }
     else
     {
         SetTran2(target, trans);
     }
 }
Example #6
0
File: Battle.cs Project: wjk17/WSA
        void StartBattle()
        {
            AudioMgr.I.PlayBGM("Battle");

            Game.I.tiles[0].Disactive();
            Game.I.tiles[1].Active();

            UICornerRT.I.Disactive();
            UIPop_InfoMenu.I.Disactive();

            Camera.main.Disable<FollowPosition>();
            Camera.main.SetPosXZ(18, 13.5f);

            CharCtrl.I.Disable<CopyPosition>();
            prevTrans = CharCtrl.I.transform.Tran2();
            RandomEnemy(); // 随机生成敌人
        }
Example #7
0
 public static void SetTran2Local(this Transform target, Tran2 trans)
 {
     target.localPosition = trans.pos;
     target.localRotation = trans.rot;
 }
Example #8
0
 public static void SetTran2(this Component target, Tran2 trans)
 {
     target.transform.position = trans.pos;
     target.transform.rotation = trans.rot;
 }
Example #9
0
 public static void SetTran2(this Transform target, Tran2 trans)
 {
     target.position = trans.pos;
     target.rotation = trans.rot;
 }