public void Awake() { player = GameObject.FindGameObjectWithTag("Control").GetComponent <Control>().GetPlayer(); control = player.inputControl; transform.Find("ExplorationModeButton").GetComponent <Button>().onClick.AddListener(delegate { SetInterfaceModeExploration(); }); transform.Find("IndustryModeButton").GetComponent <Button>().onClick.AddListener(delegate { SetInterfaceModeExploration(); }); moveSetIcons[0] = transform.Find("MoveSetDisplay").transform.Find("PrimaryActionBar").transform.Find("ActionButton0").gameObject; moveSetIcons[1] = transform.Find("MoveSetDisplay").transform.Find("PrimaryActionBar").transform.Find("ActionButton1").gameObject; moveSetIcons[2] = transform.Find("MoveSetDisplay").transform.Find("PrimaryActionBar").transform.Find("ActionButton2").gameObject; moveSetIcons[3] = transform.Find("MoveSetDisplay").transform.Find("PrimaryActionBar").transform.Find("ActionButton3").gameObject; moveSetIcons[4] = transform.Find("MoveSetDisplay").transform.Find("PrimaryActionBar").transform.Find("ActionButton4").gameObject; moveSetIcons[5] = transform.Find("MoveSetDisplay").transform.Find("SecondaryActionBar").transform.Find("ActionButton0").gameObject; moveSetIcons[6] = transform.Find("MoveSetDisplay").transform.Find("SecondaryActionBar").transform.Find("ActionButton1").gameObject; moveSetIcons[7] = transform.Find("MoveSetDisplay").transform.Find("SecondaryActionBar").transform.Find("ActionButton2").gameObject; moveSetIcons[8] = transform.Find("MoveSetDisplay").transform.Find("SecondaryActionBar").transform.Find("ActionButton3").gameObject; moveSetIcons[9] = transform.Find("MoveSetDisplay").transform.Find("SecondaryActionBar").transform.Find("ActionButton4").gameObject; moveSetIconSprites = Resources.LoadAll <Sprite>("Sprites/_UI/combat_move_icons"); hudElementSprites = Resources.LoadAll <Sprite>("Sprites/_UI/hud_elements_01"); moveSetIconBoxSprite = hudElementSprites[12]; moveSetIconBoxSpritePressed = hudElementSprites[13]; moveSetIconBoxSpriteHighlighted = hudElementSprites[11]; moveSetIconBoxSpriteDisabled = hudElementSprites[17]; }
void Update() { if (control == null) { if (isInteracting) { return; } control = ClientScene.FindLocalObject(new NetworkInstanceId(controlID)).GetComponent <CreatureControl>(); return; } if (control.isHudCommand) { return; } MouseMovement(); Jump(); switch (control.interfaceMode) { case "combat": CombatMain(); break; case "exploration": ExplorationMain(); break; } display.transform.position = new Vector3(transform.position.x + 0.1f, transform.position.y + 0.55f + z, 0); }
// Use this for initialization void Awake() { inputControl = GetComponent <CreatureControl>(); inputControl.isPlayerControlled = true; mainControl = GameObject.FindGameObjectWithTag("Control").GetComponent <Control>(); mainControl.players.Add(this); DontDestroyOnLoad(transform.gameObject); }
public void Awake() { player = GameObject.FindGameObjectWithTag("Control").GetComponent <Control>().GetPlayer(); control = player.inputControl; detailsBox = transform.Find("DetailsBox").transform.Find("Text").GetComponent <Text>(); transform.Find("IndustryModeButton").GetComponent <Button>().onClick.AddListener(delegate { SetInterfaceModeCombat(); }); transform.Find("CombatModeButton").GetComponent <Button>().onClick.AddListener(delegate { SetInterfaceModeCombat(); }); }
void Awake() { Player localPlayer = GameObject.FindGameObjectWithTag("Control").GetComponent <Control>().GetPlayer(); cam = localPlayer.mainCamera.transform; transform.position = new Vector3(cam.position.x, cam.position.y + 1.5f, transform.position.z); control = localPlayer.inputControl; user = localPlayer.creature; user.control = null; installation = user.interactionInstallation; InterfaceOverlayUI = GameObject.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/InterfaceOverlays/InterfaceOverlayUI"), Vector3.zero, Quaternion.identity); InterfaceOverlayUI.transform.SetParent(localPlayer.mainCanvas.transform, false); InterfaceOverlayUI.transform.localPosition = new Vector3(0f, 192f, 0f); InterfaceOverlayAwake(); }