Пример #1
0
 private void Start()
 {
     kills            = 0;
     lastCollidedWith = null;
     attack_charge    = 0;
     rb = this.gameObject.GetComponent <Rigidbody>();
 }
Пример #2
0
 public int DeRegisterPoolBall(PoolBallController ball)
 {
     poolBallControllers.Remove(ball);
     Debug.Log("Ball killed! " + ball.name);
     UIManager.instance.SetMessage("Ball killed! " + ball.name);
     return(poolBallControllers.Count);
 }
Пример #3
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.GetComponent <PoolBallController>() != null)
        {
            lastCollidedWith = other.gameObject.GetComponent <PoolBallController>();
            //Do Blood Effect
            //TODO: Damage here??
//            EffectsManager.instance.DoCollide(this.gameObject, 1f);
        }
    }
Пример #4
0
    private void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        player = GameObject.Find("Player").GetComponent <PoolBallController>();

        Init();
    }
    // Start is called before the first frame update
    void Start()
    {
        if (poolBallController == null)
        {
            if (this.gameObject.GetComponent <PoolBallController>() == null)
            {
                poolBallController = this.gameObject.AddComponent <PoolBallController>();
            }
            else
            {
                poolBallController = this.gameObject.GetComponent <PoolBallController>();
            }
        }

        rb = GetComponent <Rigidbody>();
    }
Пример #6
0
    // Start is called before the first frame update
    void Start()
    {
        if (poolBallController == null)
        {
            if (this.gameObject.GetComponent <PoolBallController>() == null)
            {
                poolBallController = this.gameObject.AddComponent <PoolBallController>();
            }
            else
            {
                poolBallController = this.gameObject.GetComponent <PoolBallController>();
            }
        }

        GameManager.instance.RegisterPoolBall(poolBallController);

        rb = GetComponent <Rigidbody>();

        FindClosestBall();
    }
Пример #7
0
 public void RegisterPoolBall(PoolBallController ball)
 {
     //  Debug.Log("Registering ball " + ball.name);
     poolBallControllers.Add(ball);
 }