Exemplo n.º 1
0
    // Start is called before the first frame update
    void Start()
    {
        var my_mass = GetComponent <Rigidbody>().mass;
        var fly     = GetComponent <FlyingScript>();
        var k       = fly.stiffness_coefficient;

        CenterPointPos    = (fly.A_point_transform.position + fly.B_point_transform.position) / 2;
        mapsBoxSct        = mapsBox.GetComponent <MuvementMapLib>();
        distanceToTimeMap = mapsBoxSct.muveMap[my_mass][k];
    }
Exemplo n.º 2
0
 void Awake()
 {
     flyScr  = player.gameObject.GetComponent <FlyingScript>();
     _rb     = player.gameObject.GetComponent <Rigidbody>();
     mapsLib = gameObject.GetComponent <MuvementMapLib>();
     try
     {
         mass = _rb.mass;
         stiffness_coefficient = flyScr.stiffness_coefficient;
         var some = mapsLib.muveMap[_rb.mass][flyScr.stiffness_coefficient];
         gameObject.GetComponent <DictTimeDistanceCreater>().enabled = false;
         this.enabled = false;
     }
     catch (SystemException e)
     {
         Debug.Log("Error!  " + e);
         Debug.Log("Подождите... Идёт попытка исправить...");
         gameObject.GetComponent <DictTimeDistanceCreater>().enabled = true;
         player.gameObject.GetComponent <DistanceToTimeTranslaterScript>().enabled = false;
         Cam.SetActive(false);
     }
 }