private void OnTriggerStay(Collider other) { if (other.CompareTag("ColliderTrail")) { CollidingTrail collidingTrailObj = other.gameObject.GetComponent <CollidingTrail>(); if (collidingTrailObj != null) { TrailType colliderType = collidingTrailObj.trailType; if (colliderType == enemyColor) { sicknessScaler = 1; if (sickness > 3f) { sickness = 0f; Destroy(gameObject); dropVirus(); } } else { sicknessScaler = -1; } } } }
// initializes fields for this object public void initialize() { trailType = getRandomTrailType(); switch (trailType) { case TrailType.edgyShadow: currentTrailRenderer = generateShadowLineRenderer(); break; case TrailType.basic: currentTrailRenderer = generateBasicLineRenderer(); break; case TrailType.iceMagic: case TrailType.sithLord: currentTrailRenderer = generateSithLordLineRenderer(); break; case TrailType.archimedeanSprial: case TrailType.rainbow: default: currentTrailRenderer = generateRainBowLineRenderer(); break; } rigidBody = GetComponent <Rigidbody>(); previousPositions = new Queue <Vector3>(QUEUE_SIZE); isInitialized = true; }
internal static void Save() { PluginConfig.Instance.lastSaber = CurrentlySelectedSaber; PluginConfig.Instance.trailType = TrailType.ToString(); PluginConfig.Instance.customEventsEnabled = CustomEventsEnabled; PluginConfig.Instance.randomSabersEnabled = RandomSabersEnabled; PluginConfig.Instance.showSabersInSaberMenu = ShowSabersInSaberMenu; PluginConfig.Instance.overrideCustomTrailLength = OverrideTrailLength; PluginConfig.Instance.trailLength = TrailLength; PluginConfig.Instance.saberWidthAdjust = SaberWidthAdjust; PluginConfig.Instance.disableWhitestep = DisableWhitestep; }
//LineRenderer line; //void Awake () { // Vector3 size = new Vector3 (widthZone, 0, lengthZone); // bounds = new Bounds (transform.position, size); // line = GetComponent<LineRenderer> (); // line.positionCount = 5; // line.SetPosition (0, new Vector3 (bounds.min.x, bounds.center.y, bounds.min.z)); // line.SetPosition (1, new Vector3 (bounds.min.x, bounds.center.y, bounds.max.z)); // line.SetPosition (2, new Vector3 (bounds.max.x, bounds.center.y, bounds.max.z)); // line.SetPosition (3, new Vector3 (bounds.max.x, bounds.center.y, bounds.min.z)); // line.SetPosition (4, new Vector3 (bounds.min.x, bounds.center.y, bounds.min.z)); // //posFrom = posTo; // //posTo.x = bounds.max.x; // //posTo.z = bounds.max.z; // //Debug.DrawLine (posFrom, posTo); //} public void InitTrail(string tag, TrailType trailType) { //float x = Random.Range (bounds.min.x, bounds.max.x); //float z = Random.Range (bounds.min.z, bounds.max.z); //Vector3 trailPos = new Vector3 (x, bounds.center.y, z); if (trailType == TrailType.trail) { Vector3 trailPos = transform.position; GameObject trail = Instantiate(setTrailsPrefab, trailPos, Quaternion.identity, transform); SetTrails st = trail.GetComponent <SetTrails>(); st.name = "trail"; st.startTransform = trail.transform; st.endTransform = GameObject.FindGameObjectWithTag(tag).transform; st.trail = trailPrefab; st.corr = corr; st.rad = rad; st.dim = dim; st.Run(); } else if (trailType == TrailType.smell) { Vector3 smellPos = transform.position; GameObject smell = Instantiate(setSmellPrefab, smellPos, Quaternion.identity, transform); SmellsController sc = smell.GetComponent <SmellsController>(); sc.name = "smell"; sc.start = smell.transform; sc.rabbit = GameObject.FindGameObjectWithTag(tag).transform; sc.corr = corr; sc.rad = rad; sc.dim = dim; sc.pref = smellPrefab; sc.GeneratePath(); sc.InitSmells(); } else if (trailType == TrailType.sound) { Vector3 smellPos = transform.position; GameObject sound = Instantiate(setSoundPrefab, smellPos, Quaternion.identity, transform); SmellsController sc = sound.GetComponent <SmellsController>(); sc.name = "sound"; sc.start = sound.transform; sc.rabbit = GameObject.FindGameObjectWithTag(tag).transform; sc.corr = corr; sc.rad = rad; sc.dim = dim; sc.pref = soundPrefab; sc.GeneratePath(); sc.InitMouseSounds(); } }
public static ISMAuditTrail GetInstance(TrailType type, ApplicationMetadata name) { var typestring = type == TrailType.Creation ? 2 : 6; var namestring = type == TrailType.Creation ? "Problem_Submittal" : "Provide_Problem_Information"; var routing = GetRouting(name); return(new ISMAuditTrail { BeginTime = DateTime.Now.ToUniversalTime(), EndTime = DateTime.Now.ToUniversalTime(), //TODO: Change so that this can be updated in the DB after the request is called Type = typestring, Name = namestring, Routing = routing }); }
public ProjectileData(ModelType model, float Speed, float SpeedVariance, float MinDamage, float MaxDamage, float basePen, float[,] ClassModifiers, bool debrisdeflector, TrailType trail) { this.modelName = model; this.speed = Speed; this.speedVariance = SpeedVariance; this.minDamage = MinDamage; this.maxDamage = MaxDamage; this.classModifiers = ClassModifiers; this.basePenetration = basePen; this.debrisDeflecter = debrisdeflector; this.trailType = trail; }
public TrailData(int trailNum, int nodeNum, TrailType trailType) { currentTrailId = -1; currentNodeIdx = -1; type = trailType; var totalNodeNum = trailNum * nodeNum; trailBuffer = new ComputeBuffer(trailNum, Marshal.SizeOf(typeof(Trail))); nodeBuffer = new ComputeBuffer(totalNodeNum, Marshal.SizeOf(typeof(Node))); var initTrail = new Trail(); var initNode = new Node() { time = -1 }; trails = Enumerable.Repeat(initTrail, trailNum).ToArray(); nodes = Enumerable.Repeat(initNode, totalNodeNum).ToArray(); trailBuffer.SetData(trails); nodeBuffer.SetData(nodes); }
/// <summary> /// Set how the trail behave. /// </summary> private void SetTrailType(TrailType type) { Runtime.ValidateRefCounted(this); RibbonTrail_SetTrailType(handle, type); }
internal static extern void RibbonTrail_SetTrailType(IntPtr handle, TrailType type);
public float lastTorsion(TrailType trailType, bool is_study = false) { return(is_study ? studyMotion.getTraj(trailType.GetHashCode()).lastTorsion() : curMotion.getTraj(trailType.GetHashCode()).lastTorsion()); }
/// <summary> /// 此接口用于设置那个轨迹要绘制哪个不绘制 /// </summary> /// <param name="trailType">需要切换的轨迹类型</param> /// <param name="IsOn">该轨迹开启绘制还是关闭绘制</param> public void SwitchTrailCurve(TrailType trailType, bool IsOn) { Debug.Log(trailType + "---------" + IsOn); curMotion.getTraj(trailType.GetHashCode()).setActive(IsOn); }
public List <float> torsion(TrailType trailType) { return(curMotion.getTraj(trailType.GetHashCode()).torsion()); }
public List <float> curvature(TrailType trailType) { return(curMotion.getTraj(trailType.GetHashCode()).curvature()); }
public List <float> acceleration(TrailType trailType) { return(curMotion.getTraj(trailType.GetHashCode()).acceleration()); }
//-------------轨迹图表---------------- public List <float> speed(TrailType trailType) { return(curMotion.getTraj(trailType.GetHashCode()).speed()); }
public void SwitchTrail(TrailType trailType, bool IsOn) { m_TrailController.SwitchTrailCurve(trailType, IsOn); }