public void UpdateRenderer(SpaceshipMetadata _meta)
    {
        var speedNormalize = _meta.GetSpeedCurrentNormalize();
        var time           = Mathf.Lerp(0.0f, maxTime, speedNormalize);

        //foreach (var trail in trails)
        //trail.time = time;
    }
示例#2
0
    public void InitializeSpaceship()
    {
        //Input
        ApplyInpytComponent();

        //coroutine = null;
        speedCoroutine = null;
        point          = null;
        targets.Clear();

        data = Global.Instance.PROFILE.spaceships.Find(x => x.model == model);
        if (data == null)
        {
            //Debug.LogWarning("<color=#FF0000>[SpaceshipController] \"data\" is null!</color>");
            //model = "ERROR";
            //return;

            data = new SpaceshipData(model);

            //TODO: TEST
            data.ApplyDefault();

            Global.Instance.PROFILE.spaceships.Add(data);
        }

        config = data.GetConfig();

        meta = new SpaceshipMetadata(data, config, isPlayer);

        SizeType = (EnumSizeType)config.sizeType;

        ApplyWeapons();

        material = data.material;
        //LoadedMainMesh();
        LoadedMainMaterial();

        Title = string.Format("{0} MK-{1}", data.model.ToUpper(), data.mk);

        CreateMarker();
    }