Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

扉の開閉 #41

Closed
wants to merge 7 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
442 changes: 442 additions & 0 deletions Assets/DoorControl.unity

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions Assets/DoorController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DoorController : MonoBehaviour//, IInteractable //IInteractableを継承
{
public GameObject door;
bool isOpen; //falseが閉まっている状態、trueが開いている状態
//Interactメソッドが呼ばれるとisOpen切り替え、trueかfalseでOpenかCloseのメソッド呼び出し
public void Interact(/*PlayerManager playerManager*/)
{
isOpen = !isOpen;
}
void Start()
{
isOpen = false; //最初は閉まっている

}

void Update()
{
Debug.Log(transform.position.x);
if (isOpen)
{
Open();
}
else if (!isOpen)
{
Close();
}
}

private void Close()
{
iTween.MoveTo(door, iTween.Hash("x", 3f));
}

private void Open()
{
iTween.MoveTo(door, iTween.Hash("x", -3f));
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Assets/Externals
Submodule Externals deleted from 7884c5
1 change: 0 additions & 1 deletion Assets/Models
Submodule Models deleted from adb9fd
9 changes: 0 additions & 9 deletions Assets/Models.meta

This file was deleted.

9 changes: 0 additions & 9 deletions Assets/Plugins.meta

This file was deleted.

9 changes: 0 additions & 9 deletions Assets/Plugins/UniRx/Examples.meta

This file was deleted.

82 changes: 0 additions & 82 deletions Assets/Plugins/UniRx/Examples/Sample01_ObservableWWW.cs

This file was deleted.

12 changes: 0 additions & 12 deletions Assets/Plugins/UniRx/Examples/Sample01_ObservableWWW.cs.meta

This file was deleted.

24 changes: 0 additions & 24 deletions Assets/Plugins/UniRx/Examples/Sample02_ObservableTriggers.cs

This file was deleted.

12 changes: 0 additions & 12 deletions Assets/Plugins/UniRx/Examples/Sample02_ObservableTriggers.cs.meta

This file was deleted.

23 changes: 0 additions & 23 deletions Assets/Plugins/UniRx/Examples/Sample03_GameObjectAsObservable.cs

This file was deleted.

This file was deleted.

66 changes: 0 additions & 66 deletions Assets/Plugins/UniRx/Examples/Sample04_ConvertFromUnityCallback.cs

This file was deleted.

This file was deleted.

39 changes: 0 additions & 39 deletions Assets/Plugins/UniRx/Examples/Sample05_ConvertFromCoroutine.cs

This file was deleted.

Loading