示例#1
0
 // Start is called before the first frame update
 void Start()
 {
     currentHealth = maxHealth;
     healthBar.setMaxHealth(maxHealth);
     audioManager = FindObjectOfType <AudioManager>();
     bloodPool    = BloodPool.Instance;
 }
示例#2
0
 // Use this for initialization
 void Start()
 {
     isActive       = false;
     rend           = GetComponent <Renderer>();
     attachedPlayer = GetComponentInParent <Player>();
     bloodPool      = FindObjectOfType <BloodPool>();
 }
示例#3
0
    // Use this for initialization
    protected override void Start()
    {
        base.Start();
        bloodPool = FindObjectOfType <BloodPool>();

        livingPlayers.Add(this);
        EnterState(PlayerState.ALIVE);

        if (playerID == "1")
        {
            Select();
        }
    }
示例#4
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
            //DontDestroyOnLoad(gameObject);
        }
        else
        {
            Destroy(gameObject);
        }

        pool = new Queue <GameObject[]>();
        Init();
    }
示例#5
0
    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;
        }
    }
示例#6
0
 private void Awake()
 {
     Instance = this;
 }
示例#7
0
 void Awake()
 {
     pool = this;
 }