コード例 #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
ファイル: BloodPool.cs プロジェクト: 28WeeksLater/ZombieGame
    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
ファイル: BloodPool.cs プロジェクト: Aseanseen/2Dungeon
 private void Awake()
 {
     Instance = this;
 }
コード例 #7
0
ファイル: BloodPool.cs プロジェクト: reqnux/reqnux_TillDeath
 void Awake()
 {
     pool = this;
 }