private void pointArrowTo(int index) { //kill remaining arrow if (lastArrow != null) { Destroy(lastArrow.gameObject); } //create arrow CharacterPointer arrow = ((Transform)Instantiate(arrowPrefab)).GetComponent <CharacterPointer>(); arrow.objectToFollow = characters[currentPlayer].transform; lastArrow = arrow; }
public CharacterSelectionScreen() { spriteFont = IO.LoadFont("Data/Global/AmudeFont"); selectedCharacters = new List <String>(); containerTexture = IO.LoadSingleTexture(CHARACTERSELECTION_ROOT_DIRECTORY + "container"); containerPosition = new Vector2(100, 50); selectedTexture = IO.LoadSingleTexture(CHARACTERSELECTION_ROOT_DIRECTORY + "selected"); profileTexturePosition = new Vector2(DEFAULT_PROFILE_X, DEFAULT_PROFILE_Y); titlePlayerPosition = new Vector2(170, 527); netPlayerPosition = new Vector2(350, 527); characterItems = new List <IMenuItem>(); characters = new List <Character>(); characterProfiles = new List <Texture2D>(); int i = 0; foreach (string key in Bundle.Characters.Keys) { characters.Add(Bundle.Characters[key]); characterItems.Add(new ImageMenuItem(key + "-profile", AbstractScreen.CHARACTER_PROFILES_PATH) { Position = GetProfilePosition(i++), ModifyColor = false }); characterProfiles.Add(IO.LoadSingleTexture(AbstractScreen.CHARACTER_PROFILES_PATH + key + "-profile")); } characterProfilesOrigin = new Vector2(0, characterProfiles[0].Height); characterPointer = new CharacterPointer(characterItems); menuItems = new List <IMenuItem>(); menuItems.Add(new ImageMenuItem("imready", CHARACTERSELECTION_ROOT_DIRECTORY)); menuItems.Add(new ImageMenuItem("cancel", CHARACTERSELECTION_ROOT_DIRECTORY)); for (i = 0; i < menuItems.Count; i++) { menuItems[i].Position = new Vector2(DEFAULT_MENUITEM_X + (DEFAULT_MENUITEM_SPACING)*i, DEFAULT_MENUITEM_Y); } pointer = new Pointer(menuItems); LoadContent(); }
void OnTriggerStay(Collider other) { if (other.collider.tag == "character") { RaycastHit hit; Vector3 dir = (other.collider.transform.position - transform.parent.position).normalized; int wallCharLayerMask = 1 << 9 | 1 << 10; float dist = Vector3.Distance(transform.parent.position, other.collider.transform.position); if (Physics.Raycast(transform.parent.position, dir, out hit, dist, wallCharLayerMask)) { if (hit.collider.tag == "character") { CharacterPointer poop = (CharacterPointer)hit.collider.gameObject.GetComponent(typeof(CharacterPointer)); SendMessageUpwards("EnemySighted", poop.character); } } else { SendMessageUpwards("EnemyOutOfSight"); } } }
private void pointArrowTo(int index) { //kill remaining arrow if (lastArrow != null) { Destroy(lastArrow.gameObject); } //create arrow CharacterPointer arrow = ((Transform)Instantiate(arrowPrefab)).GetComponent<CharacterPointer>(); arrow.objectToFollow = characters[currentPlayer].transform; lastArrow = arrow; }
void Awake() { // activeMenu = moveChooser; // ReturnToBaseMenu(); staticCharacterPointer = characterPointer; }