void SetLineRenderersColor() { if (_LineRendererBG != null) { MiroV1ModelSetting modelSet = _model.GetComponent <MiroV1ModelSetting> (); Color cr = modelSet._colorSetting._ENBG; LineRendererSetting.SetColor(_LineRendererBG, cr); } }
void SetLineRenderersColor() { MiroV1ModelSetting modelSet = _model.GetComponent <MiroV1ModelSetting> (); Color cr = modelSet._colorSetting._ENMax; foreach (LineRenderer lr in _StrokeLineRenderers) { LineRendererSetting.SetColor(lr, cr); } }
void Update() { Transform srcTF = GetSourceTF(); if (srcTF == null) { MiroModelV1 modelA = GetMiroModelA(); _modelSetting = modelA.GetComponent <MiroV1ModelSetting> (); SetSourceTFFromENGenerator(modelA); Transform tfB = _pumpCtrl.GetAnchorTFB(); Lyu.KeepOffset keepOffset = tfB.GetComponent <Lyu.KeepOffset> (); Transform tfBAnchor = keepOffset._Anchor; SetTarget(tfBAnchor); } }
public bool TurnDynamicsAt(Hex coord, bool bON) { MiroModelV1 model = _GridCtrl.GetMiroModelAt(coord); if (model == null) { return(false); } else { MiroModelDynamicsCtrl dynCtrl = model.GetComponent <MiroModelDynamicsCtrl> (); if (dynCtrl == null) { return(false); } else { dynCtrl.TurnAllDynamics(bON); return(true); } } }
// Update is called once per frame void Update() { bool bA2B, bB2A; // get comps CellObjCtrl ctrlA = _TwoLink._A.GetComponent <CellObjCtrl> (); MiroModelV1 modelA = GetModelFromCellObj(_TwoLink._A); MiroV1ModelSetting modelSettingA = null; if (modelA != null) { modelSettingA = modelA.GetComponent <MiroV1ModelSetting> (); } MiroModelV1 modelB = GetModelFromCellObj(_TwoLink._B); CellObjCtrl ctrlB = _TwoLink._B.GetComponent <CellObjCtrl> (); MiroV1ModelSetting modelSettingB = null; if (modelB != null) { modelSettingB = modelB.GetComponent <MiroV1ModelSetting> (); } // check direction bA2B = IsXPointToY(ctrlA, ctrlB); bB2A = IsXPointToY(ctrlB, ctrlA); bool bBias = bA2B && bB2A; // compute at float dt = Time.deltaTime; int ata = 0; if (modelA != null) { ata = bA2B ? modelA.GetAT() : 0; } _ATAF = Mathf.Lerp(_ATAF, ata, dt * _LerpSpd); int atb = 0; if (modelB != null) { atb = bB2A? modelB.GetAT():0; } float lerpT = dt * _LerpSpd; _ATBF = Mathf.Lerp(_ATBF, atb, lerpT); // get Width float wdA = _WdOnAT.Evaluate(_ATAF) * _WdMult; float wdB = _WdOnAT.Evaluate(_ATBF) * _WdMult; if (!bA2B) { wdA = 0.0f; } if (!bB2A) { wdB = 0.0f; } _WdA = Mathf.Lerp(_WdA, wdA, lerpT); _WdB = Mathf.Lerp(_WdB, wdB, lerpT); // config LR Transform tfa, tfb; tfa = _TwoLink._A.transform; tfb = _TwoLink._B.transform; ConfigLR(_LRAB, tfa, tfb, modelSettingA, _ATAF, _WdA, bBias); ConfigLR(_LRBA, tfa, tfb, modelSettingB, _ATBF, -_WdB, bBias); }