コード例 #1
0
 // Start is called before the first frame update
 void Start()
 {
     name             = transform.parent.name;
     ballDur          = GetComponent <BallDurability>();
     ballCollision    = GetComponent <BallCollision>();
     nameplateDisplay = GetComponent <NameplateDisplay>();
 }
コード例 #2
0
    private void Start()
    {
        rb          = GetComponent <Rigidbody>();
        ballDur     = GetComponent <BallDurability>();
        ballPhysics = GetComponent <BallPhysics>();
        nameplate   = GetComponent <NameplateDisplay>();

        //Initialise ballConfig values
    }
コード例 #3
0
ファイル: BallPhysics.cs プロジェクト: Felix-Aberg/TwitchGame
    // Start is called before the first frame update
    void Start()
    {
        child    = transform.GetChild(0);
        rotation = transform.parent.GetChild(1);

        rb              = GetComponent <Rigidbody>();
        ballDur         = GetComponent <BallDurability>();
        cfg             = GetComponent <BallCollision>().ballConfig;
        childPosition   = child.localPosition;
        rb.centerOfMass = Vector3.zero;

        layer = LayerMask.NameToLayer("Map");

        circleSpeed = Random.Range(cfg.minCircleSpeed, cfg.maxCircleSpeed);
        dir         = Random.Range(0f, 360f);
        if (Random.value < 0.5f)
        {
            circleSpeed *= -1;
        }

        NewCircular();
    }