示例#1
0
    public static UITargetFollow GetInstance()
    {
        if (instance == null)
        {
            instance = new UITargetFollow();
        }

        return(instance);
    }
示例#2
0
 void OnWillRenderObject()
 {
     if (rendering)
     {
         return;
     }
     if (Camera.current.name == "AimCamera")
     {
         Debug.Log("Rendering Object");
         rendering = true;
         UITargetFollow.GetInstance().AddToTargets(transform.root.gameObject);
     }
 }
示例#3
0
 void Awake()
 {
     instance = this;
 }
示例#4
0
 void OnBecameInvisible()
 {
     rendering = false;
     UITargetFollow.GetInstance().RemoveTargets(transform.root.gameObject);
 }