Exemplo n.º 1
0
    public void Awake()
    {
        character = GetComponentInChildren <CreatureCptCharacter>();

        playerPickUp = new PlayerPickUp(this);
        playerRay    = new PlayerRay(this);

        InvokeRepeating("UpdatePlayerData", 0.2f, 0.2f);
    }
Exemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        Rb          = player.GetComponent <Rigidbody2D>();
        Rb.position = startPos;

        _ray = player.GetComponentInChildren <PlayerRay>();
        _ray.gameObject.SetActive(false);
        _fireRemaining = 0.0f;
        _isFiring      = false;
        health         = maxHealth;

        sptmp = speed;
    }
Exemplo n.º 3
0
    public List <Vector2> GetIntersections(PlayerRay playerRay)
    {
        List <Vector2> results = new List <Vector2>();

        for (int i = 0; i < _pointCount - 1; i++)
        {
            for (int j = 0; j < playerRay._pointCount - 1; j++)
            {
                Vector2 intersection = new Vector2();
                if (GetIntersection(_points[i], _points[i + 1], playerRay._points[j], playerRay._points[j + 1], ref intersection))
                {
                    results.Add(intersection);
                }
            }
        }

        return(results);
    }
Exemplo n.º 4
0
 void Start()
 {
     GM     = GameObject.Find("GameManager").GetComponent <GameManager>();
     RB     = GetComponent <Rigidbody>();
     myRays = GetComponent <PlayerRay>();
 }