Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        if (gm == null)
        {
            gm = GetComponent <GameManager> ();
        }

        if (camera1 == null)
        {
            camera1 = GameObject.Find("MainCamera");
        }
        cameraAnimator = camera1.GetComponent <Animator> ();

        if (pupil == null)
        {
            pupil = GameObject.Find("Pupil");
        }
        pupilAnimator = pupil.GetComponent <Animator> ();

        if (player == null)
        {
            player = GameObject.Find("Eye");
        }

        dna       = PlayerPrefManager.GetDNA();
        highscore = PlayerPrefManager.GetHighScore();
        shields   = PlayerPrefManager.GetShields();
        supports  = PlayerPrefManager.GetSupports();
        pills     = PlayerPrefManager.GetPills();

        fp = pupil.GetComponent <FollowPointer> ();
        pc = player.GetComponent <PlayerController> ();
    }
 public void Move(Vector2 _target)
 {
     target = _target;
     if (!pointer)
     {
         pointer = body.weapon.pointer;
     }
     pointer.TargetPos = (target - pointer.ForcePoint);
     pointer.Forces();
 }
 void Start()
 {
     //body = GetComponent<Rigidbody2D>();
     bodyPointer = GetComponent <FollowPointer>();
     cam         = Camera.main;
     if (rider)
     {
         Physics2D.IgnoreCollision(GetComponent <Collider2D> (), rider.GetComponent <Collider2D> ());
         Invoke("SetTeam", 0.2f);
     }
 }
    protected virtual void Start()
    {
        thisBodyCollider = bodyObj.GetComponent <Collider2D>();
        thisBody         = bodyObj.GetComponent <Body>();
        thisCollider     = GetComponent <Collider2D>();
        if (!rb)
        {
            rb = GetComponent <Rigidbody2D>();
        }
        if (!pointer)
        {
            pointer = GetComponent <FollowPointer>();
        }

        soundbox = GetComponentInChildren <WeaponSoundbox>();
    }
Esempio n. 5
0
 protected virtual void Awake()
 {
     followPointer      = GameObject.Find("FollowPointerIcon").GetComponent <FollowPointer>();
     inventorySlotLayer = LayerMask.NameToLayer("InventorySlot");
     boxSlotLayer       = LayerMask.NameToLayer("BoxSlot");
 }