Beispiel #1
0
        private void InstantiateNewObject(float weight, Vector3 speed, Vector3 pos, float charge)
        {
            var obj        = Instantiate(chargedObjectToInstantiate, simulationSystem.transform);
            var chargedObj = obj.GetComponent <ChargedObject>();

            obj.transform.position = pos;

            chargedObj.Charge         = charge;
            chargedObj.Rigidbody.mass = weight;
            chargedObj.startVelocity  = speed;

            simulationSystem.AddNewChargedObject(chargedObj);
        }