コード例 #1
0
    private void CheckContact(GameObject otherGameObject)
    {
        if (pickUP.fillAmount < 1f)
        {
            return;
        }

        ShipColor shipColor = otherGameObject.GetComponent <ShipColor>();

        if (shipColor != null)
        {
            string sfxName = string.Format("PointCollect{0}", pickUpTier);
            AudioManager._AUDIOMANAGER.playSound(sfxName);

            ShipGridManager shipGridManager = otherGameObject.GetComponent <ShipGridManager>();
            if (shipGridManager != null)
            {
                shipGridManager.colorWake.m_VectorGrid.AddGridForce(otherGameObject.transform.position, collectionForce, collectionRadius, shipGridManager.colorWake.m_Color, true);
            }

            GameManager.PlayerColor collectorColor = GameManager._GAMEMANAGER.GetPlayerColor(shipColor.playerNumber);
            GameManager._GAMEMANAGER.ScorePoints(collectorColor, value);

            Destroy(gameObject);
        }
    }
コード例 #2
0
 // Start is called before the first frame update
 void Awake()
 {
     this.shipGridManager = GameObject.FindGameObjectWithTag("ShipGrid").GetComponent <ShipGridManager>();
     InitRaycaster();
 }