public void Init(CharacterVoice voice, string con) { if (con == "keyboard") { useController = false; } else { useController = true; } whichPlayer = con; }
// Use this for initialization void Start() { characterName = CurrentFightStats.GetSelectedCharacter(transform.GetSiblingIndex(), gameObject.tag); //characterName = "Ken"; //For testing characterSeries = CharacterSelectionMapping.GetCharacterSeries(characterName); var type = Type.GetType(characterName); character = (Character)Activator.CreateInstance(type); healthBar = new HealthBar(health.transform.GetChild(transform.GetSiblingIndex()).gameObject, character.GetHealth(), characterName); animator.runtimeAnimatorController = Resources.Load("Animation/Characters/" + characterSeries + "/" + characterName + "/" + characterName) as RuntimeAnimatorController; SetIsAI(CurrentFightStats.GetAI(transform.tag)); characterVoice = CharacterVoicePlayer.GetComponent <CharacterVoice>(); }
private void Awake() { RightAim.SetActive(false); CanonScript = transform.Find("Canon").GetComponent <Canon>(); CanonAnimator = GameObject.Find("CanonSystem").GetComponent <Animator>(); RightCanon = GameObject.Find("Canon"); Explosion = GameObject.Find("Explosion"); Explosion.SetActive(false); Rayway[0] = new Vector2(0, 1f); //上下左右 Rayway[1] = new Vector2(0, -1f); Rayway[2] = new Vector2(-1f, 0); Rayway[3] = new Vector2(1f, 0); characterVoice = GameObject.Find("CharacterAudio").GetComponent <CharacterVoice>(); enemySystem = GameObject.Find("EnemySystem").GetComponent <CEnemySystem>(); }
// Use this for initialization private void Awake() { stageManager = GameObject.Find("StageManager").GetComponent <StageManager>(); teamHp = GetComponent <PVPTeamHP>(); CharacterVoice characterVoice = GetComponent <CharacterVoice>(); for (int i = 0; i < 4; i++) { playerControls[i] = transform.GetChild(i).GetComponent <PlayerControl>(); if (i < 2) { playerControls[i].Init(this, characterVoice, true); } else { playerControls[i].Init(this, characterVoice, false); } if (i == 1 || i == 3) { playerControls[i].SetController(true, controller[i]); playerControls[i].transform.Find("CraftSystem").GetComponent <PVPCraftSystem>().Init(characterVoice, controller[i]); Debug.Log(playerControls[i] + " " + teamAMenu); if (i == 1) { teamAMenu.Init(controller[i], this.playerControls[i]); } else { teamBMenu.Init(controller[i], this.playerControls[i]); } } else { playerControls[i].SetController(false, controller[i]); playerControls[i].GetComponent <PVPAttacker>().Init(characterVoice, controller[i]); } } teamHp.Init(PVPGameOver); pvpDialog = GameObject.Find("Dialog").GetComponent <PVPDialog>(); }
public void Init(CharacterVoice voice, string con) { playerControl = GetComponent <PlayerControl>(); animator = transform.GetComponent <Animator>(); effectAudio = voice; control = con; if (con == "keyboard") { isKeyboard = true; } else { isKeyboard = false; } pickWeapon = transform.Find("PickWeapon").GetComponent <PickWeaponPVP>(); pickWeapon.SetController(!isKeyboard, control); playerControl.SubAtkFunc(AttackOver); }
void Start() { pickWeaponScript = transform.Find("PickWeapon").GetComponent <CPickWeapon>(); animator = transform.GetComponent <Animator>(); //Debug.Log("animator" + animator); animator.SetInteger("face_way", 1); animator.SetInteger("weapon_type", 0); animation_type = 0; stateinfo = animator.GetCurrentAnimatorStateInfo(0); projectileSystem = GameObject.Find("ProjectileSystem"); projectile_num = 0; EffectAudio = GameObject.Find("CharacterAudio").GetComponent <CharacterVoice>(); p1moveAble = true; p2moveAble = true; p1Ap_enough = true; p2Ap_enough = true; //Debug.Log("p1controller" + p1controller + "p1joystick" + p1joystick + "p1charaType" + p1charaType); }
public void Init(PVPPlayerManager manager, CharacterVoice voice, bool team) { playerManager = manager; effectAudio = voice; teamA = team; }