コード例 #1
0
        void Start()
        {
            TouchRayEvent.GetInstance().AddListen(target.gameObject, true, false, false);
            CanvasScaler canvasScaler = GameObject.FindObjectOfType <CanvasScaler> ();

            ratio = canvasScaler.referenceResolution.y / (float)Screen.height;
            if (!target)
            {
                target = transform;
            }
            if (!parent)
            {
                parent = new GameObject("parent").transform;
                parent.SetParent(target.parent);
                parent.localPosition    = Vector3.zero;
                parent.localEulerAngles = Vector3.zero;
                parent.localScale       = Vector3.one;
                target.SetParent(parent);
            }
        }
コード例 #2
0
 void OnDestory()
 {
     TouchRayEvent.GetInstance().RemoveListen(target.gameObject);
 }