private IEnumerator DestroyOldField(PaintChar paintChar, Action onDestroy) { _brush.DestroyPaint(_timeToDestroyOldField); HOTween.To(paintChar.gameObject.transform, _timeToDestroyOldField, "localScale", Vector3.zero); yield return(new WaitForSeconds(_timeToDestroyOldField)); Destroy(paintChar.gameObject); onDestroy(); }
public void Init() { PaintChar = transform.parent.gameObject.GetComponent <PaintChar>(); var r = gameObject.AddComponent <Rigidbody>(); r.isKinematic = true; r.useGravity = false; gameObject.GetComponent <MeshCollider>().isTrigger = true; }
public void Init(PaintChar paintChar) { _paintChar = paintChar; _transform = transform; _actor = GetComponent <TexturePaintInfluenceActor>(); _actor.colorDetails.addColor = false; _paintChar.FirstWaypoint.IsControlPoint = true; CurrentWaypoint = LastControlPoint = _paintChar.FirstWaypoint; _waypointList.AddRange(_paintChar.Waypoints.GetComponentsInChildren <Waypoint>()); if (BrushMode == BrushModeType.Hand) { _paintChar.AddTapGestureComponent(TapGestureOnStateChanged); _background.gameObject.AddComponent <TouchScript.Hit.Untouchable.Untouchable>(); _background.gameObject.GetComponent <BoxCollider>().enabled = false; } if (BrushMode == BrushModeType.HalfHand) { TapGesture = _background.gameObject.AddComponent <TouchScript.Gestures.TapGesture>(); TapGesture.StateChanged += TapGestureOnStateChanged; _paintChar.AddComponentToParts(typeof(TouchScript.Hit.Untouchable.Untouchable)); _halfHandPositionObject = new GameObject("HalfHandPositionObject"); } ResetHeadPosition(); TexturePaint.syncWithUpdate = true; if (BrushMode == BrushModeType.Autoplay) { RunAutoplay(); } _paintChar.MoveNextCharPart(); RunWayTrail(null); _isInited = true; _isCompleted = false; }
private void OnPaintCharPartIsCompletedSignal() { PaintChar.MoveNextCharPart(); }