//Called from PlayerMaster to init state information public void init(int playerNumber, int totalPlayers, Color playerColor, FillScript healthBar, Overlord o) { this.overlord = o; this.healthBar = healthBar; this.color = playerColor; this.stats = new EntityStats(); this.stats.hud = hud; this.hud.playerID = playerNumber; //Allows for items to be added in hud and stuff this.hud.player = this; overlord.resourceCore.itemSlice.gearSpawnedPlayer(this); //testing gearing playerColor.a = 1.0f; //Healthbar color - Werid issues when converting from Color to Color32 trail.material.color = playerColor; stats.recalculateStats(); this.stats.health = this.stats.maxHealth; healthBar.healthcolor.color = playerColor; this.stats.hud.updateHealthbar(); cSlice.init(stats, this, anim, healthBar); checkPlayerIDs(); //playerMesh.GetComponent<Renderer>().material.color = c; //Set the color. Don't delete, we will need this cameraSetup(totalPlayers, playerNumber); //initialize the camera based on the count of players switch (playerNumber) //Set the gamepad { case 1: gamepad = new InputController(ControllerNumber.ONE); break; case 2: gamepad = new InputController(ControllerNumber.TWO); break; case 3: gamepad = new InputController(ControllerNumber.THREE); break; case 4: gamepad = new InputController(ControllerNumber.FOUR); break; } }
// Start is called before the first frame update void Start() { chainNum = 9999; nbb = new List <GameObject>(); fillScript = GetComponentInChildren <FillScript>(); CursorManager.Instance.SetCursorVisible(true); CursorManager.Instance.SetActiveCursorType(CursorManager.CursorType.ARROW); }
public void init(EntityStats nstats, Entity en, Animator nanim, FillScript nHealthBar) { stats = nstats; //entity stats container owner = en; //entity that this slice instance is attached to if (nanim != null) { anim = nanim; //animator reference } if (nHealthBar != null) { healthBar = nHealthBar; //UI health bar } state = combatState.NORMAL; //idle state nextActionTime = 0.0f; //no previous action has been performed, so zero the cooldown period }
public void CompleteUsernamePasswordRequest(string username, string password, List <Tuple <string, string> > fields, string totp) { NSDictionary itemData = null; if (_context.ProviderType == UTType.PropertyList) { var fillScript = new FillScript(_context.Details, username, password, fields); var scriptJson = JsonConvert.SerializeObject(fillScript, _jsonSettings); var scriptDict = new NSDictionary(Constants.AppExtensionWebViewPageFillScript, scriptJson); itemData = new NSDictionary(NSJavaScriptExtension.FinalizeArgumentKey, scriptDict); } else if (_context.ProviderType == Constants.UTTypeAppExtensionFindLoginAction) { itemData = new NSDictionary( Constants.AppExtensionUsernameKey, username, Constants.AppExtensionPasswordKey, password); } else if (_context.ProviderType == Constants.UTTypeAppExtensionFillBrowserAction || _context.ProviderType == Constants.UTTypeAppExtensionFillWebViewAction) { var fillScript = new FillScript(_context.Details, username, password, fields); var scriptJson = JsonConvert.SerializeObject(fillScript, _jsonSettings); itemData = new NSDictionary(Constants.AppExtensionWebViewPageFillScript, scriptJson); } else if (_context.ProviderType == Constants.UTTypeAppExtensionSaveLoginAction) { itemData = new NSDictionary( Constants.AppExtensionUsernameKey, username, Constants.AppExtensionPasswordKey, password); } else if (_context.ProviderType == Constants.UTTypeAppExtensionChangePasswordAction) { itemData = new NSDictionary( Constants.AppExtensionPasswordKey, string.Empty, Constants.AppExtensionOldPasswordKey, password); } if (!string.IsNullOrWhiteSpace(totp)) { UIPasteboard.General.String = totp; } CompleteRequest(itemData); }