//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public void Awake() { ItemHierarchy = UnityUtil.FindComponentOrFail(ItemHierarchy, Domain); Hovercursor = UnityUtil.FindComponentOrFail(Hovercursor, Domain); DefaultItemVisualSettings = UnityUtil.CreateComponent <HovercastItemVisualSettings, HovercastItemVisualSettingsStandard>(DefaultItemVisualSettings, gameObject, Domain); DefaultItemVisualSettings.IsDefaultSettingsComponent = true; InteractionSettings = UnityUtil.FindComponentOrCreate <HovercastInteractionSettings, HovercastInteractionSettings>(InteractionSettings, gameObject, Domain); Input = UnityUtil.FindComponentOrFail(Input, Domain); vState = new HovercastState(ItemHierarchy.GetRoot(), Hovercursor, InteractionSettings.GetSettings(), Input, gameObject.transform); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ internal void Build(HovercastState pState, IItemVisualSettingsProvider pItemVisualSettingsProv) { vState = pState; vLeftRot = Quaternion.AngleAxis(180, Vector3.up); vRightRot = Quaternion.identity; var palmObj = new GameObject("Palm"); palmObj.transform.SetParent(gameObject.transform, false); vUiPalm = palmObj.AddComponent <UiPalm>(); vUiPalm.Build(vState.FullMenu, pItemVisualSettingsProv); var arcObj = new GameObject("Arc"); arcObj.transform.SetParent(gameObject.transform, false); vUiArc = arcObj.AddComponent <UiArc>(); vUiArc.Build(vState.FullMenu, pItemVisualSettingsProv); vState.OnSideChange += HandleSideChange; }