Esempio n. 1
0
        static GameObject InitController(GameObject go, int index)
        {
            Controller ctrl = go.GetComponent <Controller>();

            if (ctrl == null)
            {
                ctrl = go.AddComponent <Controller>();
            }
            ctrl._Initialize(index);
            controllers[index] = ctrl;
            return(go);
        }
Esempio n. 2
0
        static GameObject InitController(Transform tr, int index)
        {
            Controller ctrl = tr.GetComponent <Controller>();

            if (ctrl == null)
            {
                ctrl = tr.gameObject.AddComponent <Controller>();
            }
            ctrl._Initialize(index);
            controllers[index] = ctrl;
            return(tr.gameObject);
        }