Beispiel #1
0
    // Use this for initialization
    void Start()
    {
        so = SocketObject.Instance;
        Ray        ray = new Ray(transform.position, -transform.up);
        RaycastHit hit;

        if (Physics.Raycast(ray, out hit, Mathf.Infinity, mask))
        {
            if (hit.transform.gameObject.CompareTag("Stage"))
            {
                pre          = null;
                preComponent = null;
            }
            else
            {
                pre          = hit.transform.gameObject;
                preComponent = pre.GetComponent <ObsUpdate>();
                if (preComponent.fall)
                {
                    fall = true;
                }
                else
                {
                    preComponent.next = this.gameObject;
                }
            }
            return;
        }
        fall = true;
        if (core == null)
        {
            core = this.gameObject;
        }
    }
Beispiel #2
0
 public void setPrevious(GameObject g)
 {
     if (g != null)
     {
         pre          = g;
         preComponent = g.GetComponent <ObsUpdate>();
         moving       = true;
     }
     else
     {
         pre          = null;
         preComponent = null;
     }
 }