예제 #1
0
        public static bool    IsInputting(this NetworkBehaviour networkBehaviour)
        {
            //	if (networkBehaviour.isLocalPlayer)	// we can't check only this, because netControl may be null
            //		return true;

            if (!networkBehaviour.isLocalPlayer)                // commands can not be sent if isLocalPlayer is not true
            {
                return(false);
            }

            ControllableObject ncp = networkBehaviour.GetComponent <ControllableObject> ();

            if (null == ncp)
            {
                return(false);
            }

            if (null == ncp.playerOwner)
            {
                return(false);
            }

            return(ncp.playerOwner == Player.local);
        }