zoukankan      html  css  js  c++  java
  • 位置变换之棋牌

    public GameObject sp_20;
        void Update () {

            if (Input.GetMouseButtonDown(0))
            {
                OnArrange(20);
            }
        }
        /*
        100--0.3  100放大了的本地坐标  0.3世界坐标
        200--0.6
        300--0.8
        400--1.1
        500--1.4
        600--1.7
        700--1.9
        800--2.2
        900--2.5
       1000--2.8
       1050--2.9
       1080--3.0
        */
        public void OnArrange(int num) {

            for (int i = 0; i < num; i++)
            {
                /*  GameObject go = GameObject.Instantiate(sp_20, new Vector3(0, 10, 0), Quaternion.identity) as GameObject;
           go.transform.SetParent(transform);
           go.transform.localScale = Vector3.one;
           go.transform.localPosition = new Vector3(300, 0, 0);
           Debug.Log(go.transform.position);//世界坐标
           Debug.Log(go);*/

                if (i <15)
                {
                    GameObject goes = GameObject.Instantiate(sp_20, new Vector3(0, 55, 0), Quaternion.identity) as GameObject;
                    goes.transform.SetParent(transform);
                    goes.transform.localScale = Vector3.one;
                    goes.transform.localPosition = new Vector3(490-35 * i, 55, 0);
                }
                else
                {
                    GameObject goes = GameObject.Instantiate(sp_20, new Vector3(0, 55, 0), Quaternion.identity) as GameObject;
                    goes.transform.SetParent(transform);
                    goes.transform.localScale = Vector3.one;
                    goes.transform.localPosition = new Vector3(490-35 * 15, 55, 0);

                    goes.transform.localPosition = new Vector3(490-35 * (i - 15), 20, 0);
                }
            }
        }

  • 相关阅读:
    信息竞赛日志
    Lesson0423
    考试总结
    2020省队选拔前(4.13-5.31)计划
    mvcc浅析
    浅谈cgi和fastcgi
    mysql事务
    mysql慢sql优化总结
    简述缓存击穿 / 缓存雪崩 / 缓存穿透 以及各自的解决方案
    PHP的异常处理机制浅析
  • 原文地址:https://www.cnblogs.com/wanggang550/p/6108362.html
Copyright © 2011-2022 走看看