Created
May 26, 2016 05:55
-
-
Save peroon/9f962919411b7363aab24cda82be3852 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using UnityEngine; | |
| using System.Collections; | |
| // Canvasにエフェクトをのせる | |
| public class CanvasEffector : SingletonMonoBehaviour<CanvasEffector> { | |
| public GameObject starEffect; | |
| public void Star(){ | |
| // どこにおくか | |
| Vector2 pos = References.Instance.touchInput.GetUpEventPosition(); | |
| Debug.Log ("ここにエフェクト置く"); | |
| Debug.Log (pos); | |
| // 生成 | |
| var star = Instantiate(starEffect) as GameObject; | |
| star.GetComponent<RectTransform> ().anchoredPosition = pos; | |
| // 子にする | |
| star.gameObject.transform.SetParent(References.Instance.canvas.gameObject.transform); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment