void Start()
    {
        //walking UI
        symbol         = GameObject.FindGameObjectWithTag("Symbol").GetComponent <Image>(); //searches for InteractSymbol
        symbolAnimator = symbol.GetComponent <AnimateUI>();


        symbol.sprite = walkingSprites[currentWalk];
        symbolAnimator.animationSprites = walkingSprites;
        walkingSpritesOn = true;
        playerSource     = GetComponent <AudioSource>();

        //cam refs
        cameraAudSource = Camera.main.GetComponent <AudioSource>();
        camControl      = Camera.main.GetComponent <CameraController>();

        //set starting points for most vars
        player         = GetComponent <CharacterController>();
        targetPosition = transform.position;

        //turn off walking sprites at start
        ChangeAnimState(idle);

        //set current speed and startingHeight
        startingHeight = transform.position.y;
        currentSpeed   = walkSpeed;
    }
예제 #2
0
    void Start()
    {
        tpc = GameObject.FindGameObjectWithTag("Player").GetComponent <ThirdPersonController>();
        rb  = GetComponent <Rigidbody>();

        // get in boat UI
        symbol         = GameObject.FindGameObjectWithTag("Symbol").GetComponent <Image>(); //searches for InteractSymbol
        symbolAnimator = symbol.GetComponent <AnimateUI>();
        rb.isKinematic = true;
    }
예제 #3
0
 void Start()
 {
     mouseController            = gameObject.AddComponent <MouseDragRelease>();
     starSystemSpawner          = FindObjectOfType <StarSystemSpawner>();
     mySpriteRenderer           = GetComponent <SpriteRenderer>();
     myColor                    = mySpriteRenderer.color;
     myBody                     = GetComponent <Rigidbody2D>();
     myCollider2D               = GetComponent <Collider2D>();
     myTrailRender              = GetComponent <TrailRenderer>();
     animateUi                  = FindObjectOfType <AnimateUI>();
     myTrailRender.autodestruct = false;
     trailTime                  = myTrailRender.time;
     myTrailRender.time         = 0;
     StartCoroutine(InitAttractorList());
 }