示例#1
0
    // Use this for initialization
    void Start()
    {
        isGrounded  = false;
        justLanded  = true;
        gravityOn   = true;
        firstUpdate = false;

        gunOffset = new Vector3(0.0f, 0.75f, 0.50f);        //.02
        xSpeed    = 5;
        xMove     = 0.0f;

        jumpHeight    = STARTINGJUMPHEIGHT;
        jumpIncrease  = MAXJUMPINC;
        jumpFloatTime = MAXJUMPFLOATTIME;
        jumpTime      = MAXJUMPTIME;

        firstUpdateCounter = 0;

        input       = GetComponent <PlayerInput>();
        powers      = GetComponent <PlayerPowers>();
        wallJumping = GetComponent <WallJumping>();
        _HUD        = GetComponent <PlayerHUD>();
        anim        = GetComponent <AnimatorScript>();

        globals     = GameObject.Find("_Globals").GetComponent <GlobalsScript>();
        globalMusic = GameObject.Find("GlobalSoundEffects").GetComponent <GlobalMusicScript>();
        changeMusic = GameObject.Find("GlobalMusicChanger").GetComponent <ChangeVolumeGlitchMusic>();

        rb = GetComponent <Rigidbody>();
        rb.angularVelocity = Vector3.zero;
        rb.freezeRotation  = true;
    }
示例#2
0
    void Start()
    {
        prefabCharacter  = MapManager.prefab;
        arOrigin         = FindObjectOfType <ARSessionOrigin>();
        arRayCastManager = FindObjectOfType <ARRaycastManager>();
        camera           = arOrigin.GetComponentInChildren <Camera>();
        screenCenter     = camera.ViewportToScreenPoint(new Vector3(.5f, .5f));
        animatorScript   = GetComponent <AnimatorScript>();

        if (isBossFight)
        {
            animatorScript.animator = prefabBoss.GetComponent <Animator>();
        }
        else
        {
            animatorScript.animator = prefabCharacter.GetComponent <Animator>();
        }
        InvokeRepeating("UpdateNavMesh", .5f, .5f);
        if (Application.isEditor)
        {
            meshSurface = Instantiate(editorObject, new Vector3(0, -.5f, 1), Quaternion.identity);
            StartCoroutine("SpawnGround");
            CancelInvoke("UpdateNavMesh");
        }
        removeKolo = false;
    }
示例#3
0
 private void Start()
 {
     animatorScript = FindObjectOfType <AnimatorScript>();
     navMeshSurface = FindObjectOfType <NavMeshSurface>();
     navMeshAgent   = GetComponent <NavMeshAgent>();
     SetDestination();
 }
示例#4
0
    void Awake()
    {
        audioListener         = GetComponent <AudioListener>();
        audioListener.enabled = false;
        camera            = transform.Find("SpaceCamera").GetComponent <Camera>();
        hudCamera         = GameObject.FindWithTag("HUD_Camera").GetComponent <Camera>();
        hudCameraAnimator = hudCamera.gameObject.GetComponent <AnimatorScript>();
        renderCameraPanel = GameObject.FindWithTag("RenderCameraImage").GetComponent <Image>();
        renderCamera      = Camera.main;

        rigidbody       = gameObject.GetComponent <Rigidbody>();
        audioScript     = gameObject.GetComponent <AudioScript>();
        scriptNoiseTest = gameObject.GetComponent <NoiseTest>();

        Application.targetFrameRate = desiredFrameRate;

        renderCameraMaterial            = renderCameraPanel.material;
        hudCameraTexture                = new RenderTexture(1920, 1080, 0, RenderTextureFormat.Default, 0);
        spaceCameraTexture              = new RenderTexture(1920, 1080, 0, RenderTextureFormat.Default, 0);
        hudCameraTexture.antiAliasing   = 2;
        spaceCameraTexture.antiAliasing = 2;
        hudCamera.targetTexture         = hudCameraTexture;
        camera.targetTexture            = spaceCameraTexture;

        if (GameObject.FindWithTag("MainMenuCamera") != null)
        {
            //renderCameraMaterial.SetFloat("_Fade", 0);
        }
        else
        {
            StartGame();
        }
    }
示例#5
0
 void Start()
 {
     groundScan      = FindObjectOfType <GroundScan>();
     catchScript     = FindObjectOfType <CatchScript>();
     spawnattavaUkko = groundScan.prefabCharacter;
     animatorScript  = FindObjectOfType <AnimatorScript>();
     isAnimating     = false;
 }
    // Use this for initialization
    void Start()
    {
        spriteRend = this.GetComponent <SpriteRenderer>();   // grabs the spriteRenderer from the player object
        myCC       = GetComponent <CharacterController>();

        GameManager.InitializePlayer(transform.position, this);

        myAnimatorScript = GetComponent <AnimatorScript>();

        inLight = false;
    }
示例#7
0
 private void Start()
 {
     camera                      = Camera.main;
     cameraObject                = camera.gameObject;
     isProgressing               = false;
     isDecaying                  = false;
     isCaught                    = false;
     progress                    = 0;
     progressSlider.maxValue     = catchTime;
     animatorScript              = FindObjectOfType <AnimatorScript>();
     leaveMiniGameButton.enabled = false;
 }
    private void Start()
    {
        peikkoDamage      = 0;
        audioManager      = GetComponent <AudioManagerScript>();
        animationManager  = GetComponent <AnimatorScript>();
        music             = Camera.main.GetComponent <AudioSource>();
        instance          = this;
        peikkoState       = PeikkoState.DEFAULT;
        dodgeCommand      = PeikkoState.DEFAULT;
        peikkoActionCount = 0;
        Color color = attackButton.color;

        color.a            = 0;
        attackButton.color = color;
        attackButton.transform.GetComponent <Button>().interactable = false;
    }
示例#9
0
    // Use this for initialization
    void Start()
    {
        busy        = false;
        myCC        = GetComponent <CharacterController>();
        startingPos = new Vector2(transform.position.x, transform.position.z); //set the starting position
        for (int i = 0; i < pathFollowing2.Count; i++)                         //converts the list to a queue
        {
            pathFollowing.Enqueue(returnYZeroVector3(pathFollowing2[i].transform.position));
        }

        //Physics.IgnoreLayerCollision(LayerMask.NameToLayer("Enemy"), LayerMask.NameToLayer("Enemy"));

        UnwalkableMask = LayerMask.GetMask("Ground");

        player = GameObject.FindGameObjectWithTag("GamePlayer");

        myAnimatorScript = GetComponent <AnimatorScript>();
    }
示例#10
0
    // Use this for initialization
    void Start()
    {
        canMove                 = true;
        phase                   = false;
        glide                   = false;
        jump                    = false;
        isWallJump              = false;
        debugOptions            = true;
        startingKanimiCode      = false;
        differentShootingButton = false;
        firstClingUpdate        = 0;
        canMoveCounter          = 0.0f;

        stopRumble();

        physics     = GetComponent <PlayerPhysics>();
        powers      = GetComponent <PlayerPowers>();
        wallJumping = GetComponent <WallJumping>();
        anim        = GetComponent <AnimatorScript>();
        globals     = GameObject.Find("_Globals").GetComponent <GlobalsScript>();
        globalMusic = GameObject.Find("GlobalSoundEffects").GetComponent <GlobalMusicScript>();

        globals.playerInputEnabled = true;
    }
示例#11
0
 public void Start()
 {
     anime = GetComponentInChildren <AnimatorScript>();
 }
示例#12
0
 public void Start()
 {
     anime = GetComponentInChildren <AnimatorScript>();
     audio = GetComponent <AudioSource>();
 }