//makes all of the rewind managers for the object
    void CreateRewindManagers()
    {
        if (saveTransform)
        {
            TransformManager t = rewinderHolder.AddComponent <TransformManager> ();
            managerList.Add(t);
        }
        if (saveRigidBody)
        {
            RigidBodyManager r = rewinderHolder.AddComponent <RigidBodyManager> ();
            Rigidbody        b = GetComponent <Rigidbody> ();
            r.Initialize(b, b.isKinematic);
            managerList.Add(r);
        }
        if (saveExistence)
        {
            ExistenceManager e = rewinderHolder.AddComponent <ExistenceManager> ();
            managerList.Add(e);
        }

        /*	//this is for all of the rewindable scripts that may be attached to the object
         * foreach(RewindManager scr in GetComponents<RewindManager>()){
         *      managerList.Add (scr);
         * }
         */
    }
 public WorldManager(LightingManager LightManager = null, RigidBodyManager myManager = null)
 {
     myRigidBodyManager       = myManager;
     myLightManager           = LightManager;
     myCurrentResourceManager = new ResourceManager();
     myArchetypeSystem        = new ArchetypeManager();
     myWorldManager           = this;
 }
Exemple #3
0
 //Initialize vars and managers
 void Start()
 {
     PropertiesPanel.SetActive(true);
     GlobOptionPanel.SetActive(true);
     socas = Selected.GetComponent <SelectedObjectControllerAndSelecter>();
     rbm   = Selected.GetComponent <RigidBodyManager>();
     gm    = gameObject.GetComponent <GravityManager>();
     pbc   = GameObject.FindWithTag("PlayButton").GetComponent <PlayButtonController>();
 }
Exemple #4
0
 public void ReactToPropertyChange()
 {
     socas = Selected.GetComponent <SelectedObjectControllerAndSelecter>();
     rbm   = Selected.GetComponent <RigidBodyManager>();
     socas.KidsReactToPropertyDamage();
 }
Exemple #5
0
 public void delete()
 {
     rbm = Selected.GetComponent <RigidBodyManager>();
     socas.delete();
 }
Exemple #6
0
 public void reset()
 {
     socas = Selected.GetComponent <SelectedObjectControllerAndSelecter>();
     rbm   = Selected.GetComponent <RigidBodyManager>();
     socas.reset();
 }
Exemple #7
0
 public void NotSliderChanged()
 {
     rbm             = Selected.GetComponent <RigidBodyManager>();
     isSliderChanged = false;
 }
Exemple #8
0
 public void ToggleStatic()
 {
     rbm          = Selected.GetComponent <RigidBodyManager>();
     rbm.isStatic = !rbm.isStatic;
 }
    private void Start()
    {
        Manager     = GameObject.FindWithTag("Manager");
        pm          = Manager.GetComponent <PlayingManager>();
        rd          = GetComponent <Renderer>();
        SelectedMat = Resources.Load("Materials/Selected", typeof(Material)) as Material;
        DefaultMat  = Resources.Load("Materials/Default", typeof(Material)) as Material;
        rd.material = DefaultMat;
        playButton  = GameObject.FindWithTag("PlayButton");
        rbm         = GetComponent <RigidBodyManager>();
        cvs         = GameObject.FindWithTag("Canvas");
        hdui        = cvs.GetComponent <HighlightDetectionUI>();
        butter      = GetComponent <Collider>();
        butter.material.bounceCombine   = PhysicMaterialCombine.Average;
        butter.material.frictionCombine = PhysicMaterialCombine.Average;
        trueBounce = butter.material.bounciness / bounceFactor;
        trueBounce = startBounce;
        butter.material.bounciness = trueBounce * bounceFactor;
        butter.material.bounciness = trueBounce * bounceFactor;
        trueBounce = butter.material.bounciness / bounceFactor;

        posX = GameObject.Find("PositionX");
        posY = GameObject.Find("PositionY");
        posZ = GameObject.Find("PositionZ");

        rotX = GameObject.Find("RotationX");
        rotY = GameObject.Find("RotationY");
        rotZ = GameObject.Find("RotationZ");

        sclX = GameObject.Find("ScaleX");
        sclY = GameObject.Find("ScaleY");
        sclZ = GameObject.Find("ScaleZ");

        velX = GameObject.Find("VelocityX");
        velY = GameObject.Find("VelocityY");
        velZ = GameObject.Find("VelocityZ");

        angularVelX = GameObject.Find("AngularVelocityX");
        angularVelY = GameObject.Find("AngularVelocityY");
        angularVelZ = GameObject.Find("AngularVelocityZ");

        mass = GameObject.Find("MassInput");

        dynamicFriction = GameObject.Find("DynamicFrictionInput");
        staticFriction  = GameObject.Find("StaticFrictionInput");

        dynamicFriction.GetComponent <InputField>().text = startDyFric.ToString();
        staticFriction.GetComponent <InputField>().text  = startStFric.ToString();
        butter.material.dynamicFriction = startDyFric;
        butter.material.staticFriction  = startStFric;
        rbm.mass = startMass;

        elasticityInput  = GameObject.Find("ElasticityInput");
        elasticitySlider = GameObject.Find("ElasticitySlider");

        staticToggle = GameObject.Find("Static");

        reset();
        Compile();
        KidsReactToPropertyDamage();
    }
Exemple #10
0
 private void Awake()
 {
     navMeshAgent   = GetComponent <NavMeshAgent>();
     rigidBody      = GetComponent <Rigidbody>();
     gravityManager = GetComponent <RigidBodyManager>();
 }