예제 #1
0
        public void RegisterKeyholder(IKeyHolder obj)
        {
            // move monobehaviour objects into DontDestroyOnLoad scene under GateKeeper
            var keyBase = obj as MonoBehaviour;

            if (keyBase != null)
            {
                keyBase.transform.parent = gateKeeper.transform;
            }

            var methods = GetDecoratedMethods(obj);

            //Debug.LogFormat("#KEYMASTER# {0}| found {1} methods on object {2}", this, methods.Length, obj.GetType());
            for (int i = 0; i < methods.Length; i++)
            {
                //Debug.LogFormat("#KEYMASTER# {0}| registering method {1} ", this, methods[i].Name);
                RegisterMethod(methods[i], obj);
            }
        }
예제 #2
0
 static public void RegisterKeyHolder(this IKeyHolder kh)
 {
     KeyMaster.RegisterKeyholder(kh);
 }