public void Awake() { character = GetComponentInChildren <CreatureCptCharacter>(); playerPickUp = new PlayerPickUp(this); playerRay = new PlayerRay(this); InvokeRepeating("UpdatePlayerData", 0.2f, 0.2f); }
// 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; }
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); }
void Start() { GM = GameObject.Find("GameManager").GetComponent <GameManager>(); RB = GetComponent <Rigidbody>(); myRays = GetComponent <PlayerRay>(); }