public void OnTriggerEnter(Collider collider) { if (!collider.tag.Equals("Player")) { return; } NetworkIdentity identity = collider.gameObject.GetComponent <NetworkIdentity>(); if (identity == null || !identity.isLocalPlayer) { return; } TestController player = collider.gameObject.GetComponent <TestController>(); if (player == null || player.hideInfo.hide) { return; } SignPanel panel = UIMgr.instance.GetOrCreatePanel("p_ui_sign_panel") as SignPanel; panel.SetOwner(gameObject); panel.gameObject.SetActive(true); EventMgr.instance.TriggerEvent <bool>("CloseToBox", true); }
// User Logged In Successfully Changes the hole interface according to user role public void OnUserLoggedIn(object sender, LoginEventArgs e) // I must add admin / client default form event handeler subscription when implemented { // Disable Logins SignInBtn.Enabled = false; SignInBtn.Visible = false; SignUpBtn.IconChar = IconChar.SignOutAlt; SignUpBtn.Text = "Sign Out"; SignUpBtn.IconColor = RGBColors.color6; // Show the logged in panel LoggedPannel.Visible = true; LoggedLabel.Text = "Welcome " + e.User.Email + " !"; // Set user Informations to this login currentUser = e.User; // Close current child forms if (currentChildForm != null) { currentChildForm.Close(); } if (currentMenuForm != null) { currentMenuForm.Close(); } if (currentSignForm != null) { currentSignForm.Close(); } // Disable loggin panel SignPanel.Enabled = false; SignPanel.Visible = false; SignPanel.Dispose(); // check for user role and open corresponding child forms if (e.User.Role == User.Admin) { // set color for header CurrentChildFormIcon.IconColor = RGBColors.color2; CurrentChildFormTitle.ForeColor = RGBColors.color2; // Open admin forms AdminMenu adminMenu = new AdminMenu(); adminMenu.SelectedMenu += OnSelectedMenu; // Here add other event handler subscription if needed in the future OpenMenuForm(adminMenu); Adherents adherents = new Adherents(); /* * Here Add your event handelers when implemented */ OpenChildForm(adherents); } else if (e.User.Role == User.NonPayedClient || e.User.Role == User.NonRegisteredClient) { // Create Unregistered Forms UnsubscribedClientMenu unsubscribedClientMenu = new UnsubscribedClientMenu(currentUser); unsubscribedClientMenu.SelectedMenu += OnSelectedMenu; OpenMenuForm(unsubscribedClientMenu); } else if (e.User.Role == User.Client) { // Open client forms ClientMenu clientMenu = new ClientMenu(); clientMenu.SelectedMenu += OnSelectedMenu; // Here add other event handler subscription if needed in the future OpenMenuForm(clientMenu); UpdateCurrentUser(); Profile profile = new Profile(currentUser); /* * Here Add your event handelers when implemented */ OpenChildForm(profile); } }