// Start is called before the first frame update void Start() { currentHealth = maxHealth; healthBar.setMaxHealth(maxHealth); audioManager = FindObjectOfType <AudioManager>(); bloodPool = BloodPool.Instance; }
// Use this for initialization void Start() { isActive = false; rend = GetComponent <Renderer>(); attachedPlayer = GetComponentInParent <Player>(); bloodPool = FindObjectOfType <BloodPool>(); }
// Use this for initialization protected override void Start() { base.Start(); bloodPool = FindObjectOfType <BloodPool>(); livingPlayers.Add(this); EnterState(PlayerState.ALIVE); if (playerID == "1") { Select(); } }
private void Awake() { if (instance == null) { instance = this; //DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } pool = new Queue <GameObject[]>(); Init(); }
private void CreateBloodPool(Vector2 position, Vector2 normal, float force) { Debug.DrawLine(position, position + normal, Color.green, 100); GameObject poolGo = Instantiate(bloodPoolPrefab, position + (normal * .1f), Quaternion.LookRotation(Vector3.forward, normal)); BloodPool bloodPool = poolGo.GetComponent <BloodPool>(); Vector2 velocity = GetComponent <Rigidbody2D>().velocity; bloodPool.amount = Mathf.Sqrt(force); if (Mathf.Abs(normal.x) > .9f) { Debug.Log("It's vertical"); bloodPool.bias = Mathf.Sign(Physics2D.gravity.y * normal.x) > 0 ? 1 : 0; } }
private void Awake() { Instance = this; }
void Awake() { pool = this; }