Пример #1
0
    //protected bool something;

    // Start is called before the first frame update
    void Start()
    {
        joystick        = FindObjectOfType <Joystick>();
        joybutton       = FindObjectOfType <Joybutton>();
        rigidbody       = GetComponent <Rigidbody>();
        outline.enabled = false;
    }
Пример #2
0
    // Use this for initialization
    void Start()
    {
        if (!(Application.platform == RuntimePlatform.WindowsPlayer ||
              Application.platform == RuntimePlatform.LinuxPlayer ||
              Application.platform == RuntimePlatform.WindowsEditor ||
              Application.platform == RuntimePlatform.LinuxEditor))
        {
            joystick       = FindObjectOfType <Joystick> ();
            buttonFireball = GameObject.FindWithTag("Fireball").GetComponent <Joybutton>();
            buttonDash     = GameObject.FindWithTag("Dash").GetComponent <Joybutton>();
            buttonSpecial  = GameObject.FindWithTag("Special").GetComponent <Joybutton>();
            buttonFireball.setCooldown(fireballCooldown);
            buttonDash.setCooldown(dashCooldown);
        }
        canFire         = true;
        canDash         = true;
        canSpecial      = true;
        cameraOffset    = new Vector3(0f, 35f, -25f);
        spellSpawnPoint = this.transform.GetChild(1);

        playerHealth = GetComponent <PlayerHealth> ();

        playerRigidBody          = GetComponent <Rigidbody>();
        mainCamera               = Camera.main.transform;
        playerHealthBar          = this.transform.Find("Healthbar");
        playerHealthBar.rotation = mainCamera.transform.rotation;
    }
Пример #3
0
    Animator Anim; // chamando Animator


    // Start is called before the first frame update
    void Start()
    {
        joybutton = FindObjectOfType <Joybutton>();

        audioS = gameObject.GetComponent <AudioSource>();
        Anim   = GetComponent <Animator>();
    }
Пример #4
0
    void OnEnable()
    {
        runSpeed               = character.RunSpeed;
        controller             = this.gameObject.GetComponent <CharacterController2D>();
        controller.OnLandEvent = new UnityEvent();
        controller.OnLandEvent.AddListener(OnLanding);
        controller.OnCrouchEvent = new BoolEvent();
        controller.OnCrouchEvent.AddListener(OnCrouching);
        controller.m_JumpForce = character.JumpForce;
        animator = this.gameObject.GetComponent <Animator>();
        character.GameHandler = GameObject.FindObjectOfType <GameHandler>();
        Hit_Controller hit_Controller = character.Bullet.GetComponent <Hit_Controller>();

        hit_Controller.Move1 = new ObjectEvent();
        hit_Controller.Move1.AddListener(character.Move1);
        hit_Controller.Move2 = new ObjectEvent();
        hit_Controller.Move2.AddListener(character.Move2);
        hit_Controller.Move3 = new ObjectEvent();
        hit_Controller.Move3.AddListener(character.Move3);
        hit_Controller.OnMoveFinished = new UnityEvent();
        hit_Controller.OnMoveFinished.AddListener(OnMoveFinished);
        joystick  = FindObjectOfType <Joystick>();
        move1     = GameObject.FindWithTag("move1").GetComponent <Joybutton>();
        move2     = GameObject.FindWithTag("move2").GetComponent <Joybutton>();
        finalMove = GameObject.FindWithTag("finalMove").GetComponent <Joybutton>();
    }
Пример #5
0
    void Awake()
    {
        joystick  = FindObjectOfType <Joystick>();
        joybutton = FindObjectOfType <Joybutton>();

        target = GetComponentInParent <Target>();
    }
Пример #6
0
    public void PlayerSetting()
    {
        joystick  = FindObjectOfType <Joystick>();
        joybutton = FindObjectOfType <Joybutton>();

        animator  = GetComponent <Animator>();
        rigidbody = GetComponent <Rigidbody>();

        navAgent = GetComponent <NavMeshAgent>();
        navAgent.stoppingDistance = 0.7f;


        isDead = false;

        if (gameObject.transform.parent != null)
        {
            playerHpBar = gameObject.transform.parent.transform.Find("Canvas").GetComponent <PlayerHpBar>();
        }

        playerTargeting = GetComponent <PlayerTargeting>();

        characterBase  = GameManager.Instance.characterInfoList[GameManager.Instance.playerData.characterNumber];
        navAgent.speed = characterBase.speed;

        animator.SetFloat("AtkSpeed", characterBase.atkSpeed);
    }
Пример #7
0
 void Start()
 {
     joystick     = FindObjectOfType <Joystick>();                    //To defined the type of joystick
     joybutton    = FindObjectOfType <Joybutton>();                   //To defined the type of joybutton
     restartPoint = transform.position;
     rb           = GetComponent <Rigidbody>();
 }
 private void Start()
 {
     _charC = GetComponent <CharacterController>();
     // Joystick
     joystick  = FindObjectOfType <MasterJoystick>();
     joybutton = FindObjectOfType <Joybutton>();
 }
Пример #9
0
 // Start is called before the first frame update
 void Start()
 {
     //theRB = GetComponent<Rigidbody>();
     controller = GetComponent <CharacterController>();
     joystick   = FindObjectOfType <Joystick>();
     joybutton  = FindObjectOfType <Joybutton>();
 }
Пример #10
0
 void Start()
 {
     vect      = new Vector3();
     fre       = GetComponent <AudioSource>();
     joystick  = FindObjectOfType <Joystick>();
     joybutton = FindObjectOfType <Joybutton>();
 }
Пример #11
0
    private void SetUpData_LOCAL_NONLOCAL()
    {
        if (photonView.IsMine)
        {
            PlayerCamera.transform.SetParent(null, false);
            cameraController           = PlayerCamera.GetComponent <PlayerCameraController>();
            cameraController.m_XOffset = cameraOffset;

            _object      = GetComponent <GeneralController>();
            moveStick    = FindObjectOfType <MoveStick>();
            attackStick  = FindObjectOfType <AttackStick>();
            specialStick = FindObjectOfType <SpecialStick>();
            jumpButton   = FindObjectOfType <Joybutton>();

            SpecialCanvas      = GameObject.Find("Canvas - Special");
            SpecialMeterCanvas = GameObject.Find("Canvas - SpecialMeter");
            specialMeter       = GameObject.Find("Special Meter").GetComponent <Image>();
            SpecialCanvas.SetActive(false);

            PlayerNameText.text  = PhotonNetwork.LocalPlayer.NickName;
            PlayerNameText.color = Color.green;
        }
        else
        {
            PlayerCamera.SetActive(false);

            PlayerNameText.text  = photonView.Owner.NickName;
            PlayerNameText.color = Color.red;
        }
    }
Пример #12
0
 // Use this for initialization
 void Start()
 {
     joystick   = FindObjectOfType <Joystick>();
     joybutton  = FindObjectOfType <Joybutton>();
     moveSpeed  = 10f;
     animPlayer = GetComponent <Animator>();
 }
Пример #13
0
    // Start is called before the first frame update
    void Start()
    {
        joybutton = FindObjectOfType <Joybutton>();

        defaultRotationAngle = transform.localEulerAngles.y;
        currentRotationAngle = transform.localEulerAngles.y;
    }
Пример #14
0
 void Start()
 {
     player         = GameObject.FindGameObjectWithTag("Player").transform;
     playerAnim     = player.GetComponent <Animator>();
     transitionAnim = GameObject.Find("Transition").GetComponent <Animator>();
     upButton       = GameObject.Find("Up").GetComponent <Joybutton>();
 }
    // Start is called before the first frame update
    void Start()
    {
        corpo = GetComponent <Rigidbody2D>();

        joystick  = FindObjectOfType <Joystick>();
        joybutton = FindObjectOfType <Joybutton>();
    }
    private void Awake()
    {
        fadeManager = GameObject.FindGameObjectWithTag("FadeCanvas").GetComponent <FadeManager>();
        nowPlayer   = GameObject.FindGameObjectWithTag("Player");

        joystick  = FindObjectOfType <Joystick>();
        joybutton = FindObjectOfType <Joybutton>();
    }
Пример #17
0
    // Start is called before the first frame update
    void Start()
    {
        transform.position = option1.position;
        joystick = FindObjectOfType<Joystick>();
        joystick.AxisOptions = AxisOptions.Vertical;

        joybutton = FindObjectOfType<Joybutton>();
    }
Пример #18
0
 // Start is called before the first frame update
 void Start()
 {
     joystick    = FindObjectOfType <Joystick>();
     joybutton   = FindObjectOfType <Joybutton>();
     initial_pos = transform.position;
     collision   = LayerMask.GetMask("Obstacles");
     rigidbody   = GetComponent <Rigidbody>();
 }
Пример #19
0
 void Start()
 {
     myRB       = GetComponent <Rigidbody2D>();
     myRenderer = GetComponent <SpriteRenderer>();
     myAnimator = GetComponent <Animator>();
     joystick   = FindObjectOfType <Joystick>();
     joybutton  = FindObjectOfType <Joybutton>();
 }
Пример #20
0
 void Start()
 {
     verc         = new Vector3();
     souric       = GetComponent <AudioSource>();
     liftext.text = "LIFE: " + life;
     joybuttonik  = FindObjectOfType <Joybutton>();
     joystickim   = FindObjectOfType <Joystick>();
 }
Пример #21
0
 void Start()
 {
     vect         = new Vector3();
     sorchi       = GetComponent <AudioSource>();
     textLfe.text = "LIFE: " + life;
     joybuttoni   = FindObjectOfType <Joybutton>();
     joysticki    = FindObjectOfType <Joystick>();
 }
Пример #22
0
    void Start()
    {
        //Find Joysticks
        joybutton = FindObjectOfType <Joybutton>();

        //Get Components
        ControllerPlayer = GetComponent <CharacterController>();
        anim             = GetComponent <Animator>();
    }
Пример #23
0
 void Start()
 {
     joybutton = FindObjectOfType <Joybutton>();
     an        = GetComponent <Animator>();
     rb        = GetComponent <Rigidbody2D>();
     pos       = GameObject.FindGameObjectWithTag("Respawn");
     canv      = GameObject.Find("Canvas");
     InvokeRepeating("spawn", 6f, 15f);
 }
Пример #24
0
 // Start is called before the first frame update
 void Start()
 {
     joystick    = FindObjectOfType <Joystick>();
     joystickPtr = FindObjectOfType <JoystickPointer>();
     attack      = FindObjectOfType <Attack>();
     joybutton   = FindObjectOfType <Joybutton>();
     anim        = GetComponent <Animator>();
     rigidbody   = GetComponent <Rigidbody>();
 }
Пример #25
0
 internal override void Init()
 {
     currentDirection      = Direction.Up;
     isDefend              = true;
     defendTime            = 3.0f;
     role                  = Role.Player;
     _joystick             = FindObjectOfType <Joystick>();
     _joystick.AxisOptions = AxisOptions.Both;
     _joybutton            = FindObjectOfType <Joybutton>();
 }
    private void Awake()
    {
        joystick  = FindObjectOfType <Joystick>();
        joybutton = FindObjectOfType <Joybutton>();

        _objectCollider           = GetComponent <BoxCollider2D>();
        _objectCollider.isTrigger = true;

        players = GameObject.FindGameObjectsWithTag("Player");
    }
Пример #27
0
    // Use this for initialization
    void Start()
    {
        joystick   = FindObjectOfType <Joystick>();
        joybutton  = FindObjectOfType <Joybutton>();
        joybutton2 = FindObjectOfType <Joybutton2>();
        bsalir     = FindObjectOfType <Salir>();

        anim  = GetComponent <Animator>();
        anime = enemigo.GetComponent <Animator>();
    }
Пример #28
0
 // Use this for initialization
 void Start()
 {
     joystick            = FindObjectOfType <Joystick>();
     joybutton           = FindObjectOfType <Joybutton>();
     rb                  = GetComponent <Rigidbody>();
     lastPlayerDirection = new Vector3(joystick.Horizontal * velocityFactor,
                                       rb.velocity.y,
                                       joystick.Vertical * velocityFactor);
     animator = gameObject.GetComponent <Animator>();
 }
Пример #29
0
 void Start()
 {
     joystick  = FindObjectOfType <Joystick>();
     joybutton = FindObjectOfType <Joybutton>();
     anim      = GetComponent <Animator>();
     isWalking = false;
     renderer  = GetComponent <SpriteRenderer>();
     colisorAtaque.SetActive(false);
     gato = 0;
     npc  = GameObject.Find("alexia");
 }
    protected override void Awake()
    {
        base.Awake();
        carryButton = GameObject.FindWithTag("Carry Button").GetComponent <Joybutton>();
        carryButton.ButtonDownEvent += HandleCarryBySearch;

        inventory = GetComponent <Inventory>();

        storeButton = GameObject.FindWithTag("Store Button").GetComponent <Joybutton>();
        storeButton.ButtonDownEvent += inventory.SmartToggle;
    }